|
|
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
|
|
|
|
|
|
I see this article and its not problem,its working
in the GetResource it get resource and this function it call
hResInfo = FindResource(...)
whitesky
|
|
|
|
|
use GetLastError() to get the Error
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
1813 == GetLastError(), can't find resource in image file.
what is your reference and how to use it?
-- modified at 3:31 Tuesday 18th July, 2006
|
|
|
|
|
I have sent a message with "documentation" subject. But I haven't received any reply yet. I am in urgent need of it. Please help me. I made XML file out of my VC++ code in Visual Studio 2005. But I couldn't find any tools that makes .chm files out of it. NDOC only supports codes compiled by C# compiler. Is there any other tool such as NDOC that supports VC++?
Thanks in advance.
|
|
|
|
|
|
Did you get my point? I have some questions:
1. Is it possible for Doxygen to make HTML files out of VC++.NET?
2. I need a tool to convert the XML files made by Visual C++.NET 2005 into .chm format(exactly the same as NDOC functionality). Is there any tool available for this purpose?
|
|
|
|