ex: namespace mynamespace { void DoThis(void* p) { ...} } namespace mynamespace2 { void DoThis(void* p) { ...} } //you can use it like this mynamespace::DoThis(myPointer); mynamespace2::DoThis(myPointer); //or using namespace mynamespace; DoThis(myPointer); //using namespace mynamespaces Does this make sense? Recommend you check up on namespaces. :)
Ben M Stokland
Posts
-
using namespace std ? -
Abstract Template Classes?It is poosible to create abstracet template classes (just give it a try :) You inherit from them as you would a normal class. template class CBaseClass { //ex: virtual int DoIt() = 0; .... }; template class CDerive : public CBaseClass { }; //an instance: CDerive MyIntclass; shouldn't be all that difficult?
-
how to enumerate all the .txt files in some directory?FindFirstFile(...) --requires CE 1.0 or higher _findfirst(...)
-
I need to disable ESC key in ATL COM CAxDialogImpl...GetAsynchKeyState(VK_ESKAPE); (in your OnCancel(...) to check the state)
-
How can i register a .dll or .ocx file in my program similar register it using regsvr32.exe?That might have been me..:eek: http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=55401&tid=55395#xx55401xx :-D
-
Time and dateThe time and date for the threads are a bit confusing. How can someone figure out what time of day the posting was done, if they don't know what timezone the web-server is in?? How about calculating all the time/date to local time/date for the client accessing the pages. Or adding a line wich states what timezone the server is using, and maybe the current time on the server?:confused: :suss:
-
Linking error when using template class from MFC Extension DLLIt shouldn't make any difference if the implementation is in the header or in the cpp. The linker doesn't care. It's just a matter of making readable code. Doing all your implementation in the header, just makes the code harder to maintain than necessary.:suss: The key point is that the linker can't find the implementation of that method.
-
Linking error when using template class from MFC Extension DLLHave you tried to implement a method int IsEmpty(void) { ... return n; } ??? Seems like the linker can't find the body of this function... Is it a virtual class you are inheriting from? Or is int IsEmpty(void) defined as: in IsEmtpy(void) = 0; ??:confused:
-
Load DLL in programLoadLibrary, just load's the dll, so you can call functions in it. You need to have a function prototype to call a function in a dll. Lets make a function that will register a com-dll (just like regsvr32.exe does): typedef void (*f)(void); BOOL MyFuncCallsADLL(TCHAR* szDll) { f pf; // our function pointer HINSTANCE hDll = LoadLibrary(szDll); if(hDll == NULL) return FALSE; // we couldnt load library //get function address pf = (f)GetProcAddress(hDll, _T("DllRegisterServer")); if(pf == NULL) { FreeLibrary(hDll); return FALSE; //we couldn locate the function } //lets call that method pf(); FreeLibrary(hDll); return TRUE; } ;P
-
MSDN Searchhmmmm..... Yupp, but now it seems to be up and running again... :rolleyes:
-
Difference !!!E_FAIL will also throw an exception if you use Visual Basic, and S_FALSE will not.