473,321 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

static method/C++ compiler question

2
Hi, I'm trying to achieve the following:

Expand|Select|Wrap|Line Numbers
  1. typedef VOID (WINAPI *FILEIOCOMPLETIONROUTINE)(DWORD dwErrorCode,
  2.                                                                          HANDLE hEvent);
  3.  
  4. typedef class FILE
  5. {
  6.   ...
  7.   FILEIOCOMPLETIONROUTINE *pReadCompletionRoutine;
  8.   ...
  9. }
  10.  
  11.  
  12. VOID WINAPI FILE::ReadCompletionRoutine(DWORD dwErrorCode,
  13.                                                           DWORD dwNumberOfBytesRead,
  14.                                                           LPOVERLAPPED lpOverlappedRead)
  15. {
  16.   FILE *pFile;
  17.   FILEIOCOMPLETIONROUTINE *pRoutine;
  18.  
  19.   ...
  20.   pRoutine = pFile->pReadCompletionRoutine;
  21.  
  22.   *pRoutine(dwErrorCode, lpOverlappedRead->hEvent);
  23.   ...
  24. }
  25.  
and it gives mi a "call to nonfunction". When I write

Expand|Select|Wrap|Line Numbers
  1. pFile->*pReadCompletionRoutine(dwErrorCode, lpOverlappedRead->hEvent);
it's a "member cannot be used without an object in function". I wonder if there's a way around, cause I'm restricted to C++. (I'd love to write the whole thing in assembler and don't give a damn about the compiler incapability of using pFile as *this* - notice that
Expand|Select|Wrap|Line Numbers
  1. pFile->SomeFunc();
works fine).
May 14 '06 #1
1 3326
v000
2
Never mind. I've already solved the problem.
May 14 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Tim | last post by:
Please advise if you can. Presumably initialisation of members in member initialisation lists is perfomed by 'C' run-time startup. If the CRT was never started-up would those members be garbage?...
16
by: Ed Sutton | last post by:
I use a mutex to disallow starting a second application instance. This did not work in a release build until I made it static member of my MainForm class. In a debug build, first instance got...
6
by: rlvladbob | last post by:
Hi, I've try to access a static method using an instance instead of a class. public class test{ public static void ShowAText(string ThisText) { System.Console.WriteLine("->{0}",ThisText); }
15
by: dn | last post by:
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a business layer, a data access layer, and a SQL Server 2005 database, and I have a question. In the business and data...
2
by: Steve | last post by:
C# I am new to C#, and new to the whole OO concepts, and so I am sure this is a very stupid question, but I'll ask anyway. When should my methods be static? I have several "Business Objects" in...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
14
by: Jeroen | last post by:
Hi all, I've got a question about writing a library. Let me characterize that library by the following: * there is a class A which is available to the user * there is a class B that is used...
9
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to...
14
by: d-42 | last post by:
Hi, Is there any way to make this method inheritable and have it behave appropriately on inherited classes? Using generics? Extension methods? Something else? class baseClass { public...
3
by: Filip Zawada | last post by:
Hi, I've encountered a rather interesting language problem. Suppose I've got following types: //class providing usefull static methods public class GoodBase<T> { public static void Met(){};...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.