|
then... isn't it what i was saying ?
even if you write the initialization there, the code is executed at the beginning of the program (because static members are initialized like that).
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Unless the static is within a method, in which case it is initialized the first time the method is called (potentially causing some thorny multi-threaded issues).
|
|
|
|
|
Hey Guys,
What code u have provided is correct. I also mentioned same code in my question. I have 2 concerns
1) const static members can be directly init in class
so what is wrong with normal static members?
2) As normal const vars has to be init at the time of declaration in code(somewhat like references ). In my class I need to init my const var in memberwise init list.
so we have an issue where we have const needs whose init code needs to be inside class and static needs to be outside.
so the soln in compiler is put static const var outside let it be define there.
Here my question is why we can also put it inside class? what is req. forced to provide such facility? what is rational behind that?
-- modified at 6:46 Tuesday 18th July, 2006
|
|
|
|
|
Hi to all,
How to Unregister a registered dll file, with or without coding ?
As we can Register a dll using 'regsvr32.exe', is there any option to unregister the register dll?
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
To unregister regsvr32 /u C:\YourFile.OCX
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
Start->Execute
type regsvr32 and then Enter.....
you can visualize a dialog options.
regsvr32 "file path" /u
Too many plans make the health badly!!
-- modified at 2:52 Tuesday 18th July, 2006
|
|
|
|
|
|
Ex for regster given , to un reg, get function pointer of "DLLUnReg...Svr"
HCRET lpfnDllRegisterServer = NULL;
DLLName = "YouDLLName.dll";
hDLL = LoadLibrary(DLLName);
if (hDLL != NULL)
{
lpfnDllRegisterServer = (HCRET)GetProcAddress(hDLL, "DllRegisterServer");
if(NULL == lpfnDllRegisterServer)
{
//ERR
}
else
{
if(FAILED((*lpfnDllRegisterServer)()))
{
ERR ("Tripio registration failed!");
}
else
{
//"Registering DLL Success"
}
}
FreeLibrary ( hDLL );
}
else
{
ERR("LoadLibrary failed");
}
|
|
|
|
|
Hi,
I tried ur code in VC6. But it is giving me Errors like,
: 'HCRET' : undeclared identifier
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
Friend
HRECT is just a function pointer type def as
typedef HRESULT (CALLBACK *HCRET)(void);
Let me know worked or not to anilkumarkv@gmail.com
|
|
|
|
|
Aniket Salunkhe wrote: As we can Register a dll using 'regsvr32.exe', is there any option to unregister the register dll?
you can dynamically load dll and call teh dllunregister routine
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I dont understand where this routine should be called.
If possible give me an example.
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
Aniket Salunkhe wrote:
Hi,
I dont understand where this routine should be called.
If possible give me an example.
Let fatCom.dll is your DLL ....
then using LoadLibrary function load that dll in your Process memory space and using GetProcAddess Function get DllUnregister pointer and call that function!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok wrote: then using LoadLibrary function load that dll in your Process memory space and using GetProcAddess Function get DllUnregister pointer and call that function!
I use code as follow,
HCRET lpfnDllRegisterServer = NULL;
HINSTANCE hDLL = LoadLibrary("SimpleExt.dll");
if (hDLL != NULL)
{
lpfnDllRegisterServer = (HCRET)GetProcAddress(hDLL, "DllUnregister ");
if(NULL == lpfnDllRegisterServer)
MessageBox("ERR");
else
{
if(FAILED((*lpfnDllRegisterServer)()))
MessageBox("Dll registration failed!");
else
MessageBox("Registering DLL Success");
}
FreeLibrary ( hDLL );
}
else
MessageBox("LoadLibrary failed");
But it is showing MessageBox("ERR"). (in BOLD)
What is the problem?
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
Aniket Salunkhe wrote: HCRET lpfnDllRegisterServer = NULL;
lpfnDllRegisterServer should of type :- HRESULT STDAPICALLTYPE DllUnregisterServer(void)
and
Aniket Salunkhe wrote:
lpfnDllRegisterServer = (HCRET)GetProcAddress(hDLL, "DllUnregister ");
pass DllUnregisterServer instead of DllUnregister
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
The dll I am tring to Unregister/Register in written by myself using 'ATL COM Appwizard' in VC6. But when I use other dll to register/unregister using following code, it is working. Then what might be the problem?
When I register/unregister other dll (not mine). using following code (code given by u). It is working fine. But same code for my dll is not working, that dll I can register/unregister using "regsvr32" command in command prompt. Then what might be the problem ?
typedef HRESULT (CALLBACK *HCRET)(void);
HCRET lpfnDllRegisterServer = NULL;
HINSTANCE hDLL = LoadLibrary("SimpleExt.dll");
if (hDLL != NULL)
{
lpfnDllRegisterServer = (HCRET)GetProcAddress(hDLL, "DllRegisterServer");
//lpfnDllRegisterServer = (HCRET)GetProcAddress(hDLL, "DllUnregisterServer");
if(NULL == lpfnDllRegisterServer)
MessageBox("ERR");
else
{
if(FAILED((*lpfnDllRegisterServer)()))
MessageBox("Dll registration failed!");
else
MessageBox("Success");
}
FreeLibrary ( hDLL );
}
else
MessageBox("LoadLibrary failed");
ThatsAlok wrote: lpfnDllRegisterServer should of type :- HRESULT STDAPICALLTYPE DllUnregisterServer(void)
How to use this. I have declared it as,
typedef HRESULT (CALLBACK *HCRET)(void);
HCRET lpfnDllRegisterServer = NULL;
|
|
|
|
|
Hello frnds.! Is it possible to make comnd prompt to wait until an exe finishes its execution..?
|
|
|
|
|
Are you spawning another exe? There are multiple version of the spawn and exec commands that include a variation that waits for the spawned exe to finish. Is that what your looking for or are you asking to keep the command window from a command line window open after some processing to view results?
If the latter, then put something like a getchar() in there to make it wait for a keypress...
int main(int argc, char* argv[])
{
// Processing here?
printf("Press a key to continue\n");
getchar();
return 0;
}
-- modified at 2:33 Tuesday 18th July, 2006
|
|
|
|
|
U can try Sleep()
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
I use that code to find the bitmap.
HRSRC hSource = NULL;
hSource = FindResource(AfxGetResourceHandle(), MAKEINTRESOURCE(IDC_BITMAP), "BMP");
However, hSource get null.... Y?
|
|
|
|
|
Test this code
<br />
HRSRC hSource;<br />
hSource = FindResource(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_BITMAP1), RT_BITMAP);<br />
<br />
whitesky
|
|
|
|
|
|
Are you sure that IDC_BITMAP is bitmap when i run this code it dosent return a null
whitesky
|
|
|
|
|