|
Krishnakumartg wrote: By the word "registered", I mean that whether the thing "regsvr32 mydll.dll" had been done or not.
Ok.
Let us elaborate on this for while...
Like Iain said, what "regsvr32" does is simply load the .dll-file with ::LoadLibrary() , get the entry address of the exposed function DllRegisterServer() with ::GetProcAddress() and finally call DllRegisterServer() in the library.
What that function does is entirely up to the library.
In case of COM servers in DLLs, the DllRegisterServer() function is assumed to add information about the objects and interfaces exposed from the library into the registry.
There's no guaranteed way of knowing what COM servers, interfaces and/or their GUIDs just by looking into the library. Different COM servers may be created with different tools, they may or may not have the typelibrary included as a resource in the library.
Even if you walk through the registry tree below the HKCR/CLSID key and enumerate all registered servers, you may find servers that reside in files with the same name as the one provided to the application, but you have no clue whether this might be a later version if the paths differ.
You also have to consider what to do if you come to the conclusion that the DLL provided to the application has not been registered.
Are you supposed to register it? Then you can save a lot of trouble and simply register it without checking whether it was previously registered or not.
Is the user supposed to figure out if this DLL should be registered? Based on what information? How could the user possibly know?
My point is that there's no safe way of figure out whether a certain DLL has been "registered" or not. And even if there was, it's unclear what should be done with the file.
BUT, if you have a handful of COM servers and you know their IDs and interfaces, you could try to create each one of them and if the creation fails with the error REGDB_E_CLASSNOTREG you know that it has not been registered yet.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi all,
I've build the whole solution of one of my C++ project in release mode. Compilation is fine, but when the exe is building it says that one of file is missing and Interface not registered
Can someone tell me how to solve this question.
Thanks a lot
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I've never seen this message. Do you have any custom build steps in your project?
Iain.
|
|
|
|
|
CodingLover wrote: I've build the whole solution of one of my C++ project in release mode.
So you're able to build the debug version without errors?
Try to find out what the differences are..
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Actually I can compile in debug as well as release. But I cannot build it.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: Actually I can compile in debug as well as release. But I cannot build it.
That's contradiction in term as compiling is part of the build process.
Now I know the project can be successfully compiled in both debug and release version.
Are you able to link without errors?
When do you get this error?
Please be specific. You may paste the surrounding lines from your output window in your reply.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: That's contradiction in term as compiling is part of the build process.
Now I know the project can be successfully compiled in both debug and release version.
Are you able to link without errors?
Yes I can build any project in Debug or Release mode without any errors. But when I build the solution it gives an error, like this.
Building file 'E:\Test\output\Setup.msi'...
ERROR: Could not find file 'D:\Project\Starter\app.config' 'Interface not registered'
Please help me, I\m wired with this error for two days now.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Sorry, but I don't think I can help you with this.
It looks like the problem occurs when you're building the installation package and I haven't done that a lot. I thought the "interface not registered" was about a COM interface.
I suggest you post a new question in the forum and explain your problem more detailed.
Be sure to put something like "error when building installation package" in the subject line in order not to misguide people who are trying to help.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
CodingLover wrote: Actually I fix the problem
Very good.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi all
We have a situation with our custom TSP and an application . The TSP is a Telephony service provider which provides service to MS dialer . The issue is when the PC is restarted svchost.exe (which is active due to starting of TSP )consumes 50% CPU and another application X which commonly shares registry entries with TSP take long time . After 5 to 10 minutes the CPU load comes down and the application starts . The issues seems to be , as mentioned above , with the concurrent access of common resources (registry etc) by the TSP + application X . The worst case scenario is : Application X , as its unable to access registry , forgets the old configuration and a configuration application is started - which calls for trouble as a technician visit to site is mandatory in most cases . The point is : Application X is always part of Start menu and the TSP is started by service host as a service. I am searching for ideas to unblock this situation . Whats the best way to make svchost.exe and Application X not to fight for recources at the same time ?
1. Is its advisible to mutex lock the code surrounding the registry access ? (will it solve or worsen the situation ..!?)
2. Is there anyway we can make application X to be started only after starting of all services and other applications ? ie is there any way to prioritize the starting order of processes?
thanks
redindian
|
|
|
|
|
|
Hi
I am trying to check for the existance of the file "Microsoft.VC80.CRT.manifest" within a user defined folder
to try and find it i am using
dwResult = SearchPath(lpbPath,lpbFilename,lpbExt,dwBufferSize, szBuffer, &lpbPEnd);
where lpbFilename = "Microsoft.VC80.CRT"
and lpbExt = ".manifest"
lpbPath with be a user defined path passed to the function
however nothing is returned,i use this function to search for traditional file type (i.e something.ext) and this works fine
can anyone help at all
thanks
simon
|
|
|
|
|
Try BOOL PathFileExists(LPCTSTR pszPath);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: Try BOOL PathFileExists(LPCTSTR pszPath);
thanks
|
|
|
|
|
Hi All,
I am having huge C++/MFC project. from that multiple DLLs is creating but when i am trying to load a DLL using LoadLibrary funtion than it gives an error when it reaches on the following line
ASSERT(AfxGetThread() == NULL);
can any body please tell me why it is happaning.
thanks
Bankey
|
|
|
|
|
bankey1010 wrote:
ASSERT(AfxGetThread() == NULL);
You may get this assertion in a thread spawned with any other function than AfxBeginThread() . It's a common mistake to create threads with e.g. CreateThread() even though the MFC framework is used.
Verify that all secondary threads are created with AfxBeginThread() .
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Maybe the following note on AfxGetThread() documentation [^] would be useful
[Note] Note:
If you are porting an MFC project calling AfxGetThread from Visual C++ versions 4.2, 5.0, or 6.0, AfxGetThread calls AfxGetApp if no thread is found. In Visual C+ .NET and later, AfxGetThread returns NULL if no thread was found. If you want the application thread, you must call AfxGetApp.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi.....
I have a small problem, i have to print my part files of a CAD software to a pdf document.When i try printing to a pdf format, the resultant pdf is blank.Can someone tell me how to print data(current window image) to a pdf document using win32 sdk.Plse do help me out.
Thnx in advance.
|
|
|
|
|
raesa wrote: When i try printing to a pdf format, the resultant pdf is blank.
How are you currently creating a PDF?
raesa wrote: Can someone tell me how to print data(current window image) to a pdf document using win32 sdk.
You cannot print to a PDF with WIN32 SDK alone.
raesa wrote: Plse do help me out.
Unless you give a clue, nobody can help you out.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
FIrstly, thnx for the reply.I'll explain the problem clearly below:
I have a CAD environtment, UGNX(Unigraphicd NX) and i have a part displayed on the current opened window.I have to capure the contents of the current opened window(i.e., the image of the current opend window) of my UGNX session and put it into a PDF file.This is am trying to do, the file printing option which has PDF complete as one of the printing formats using PrintDLg function in win32 sdk.The result that i am getting is a blank pdf file.I dont seem to undertnd the problem.Can you plse have a look at my code below and tell me where i am going wrong.Plse do reply.
Thnk You.
Sample Code:
HDC GetPrinterDC(HWND hWndParent)
{
PRINTDLG pdlg;
// Initialize the PRINTDLG structure.
memset( &pdlg, 0, sizeof( PRINTDLG ) );
pdlg.lStructSize = sizeof( PRINTDLG );
DEVMODE hDevMode;
// Set the flag to return printer DC.
pdlg.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
pdlg.hwndOwner = hWndParent;
DEVMODE hDmode;
PrintDlg( &pdlg );
// hDC member of the PRINTDLG structure contains
// the printer DC.
return pdlg.hDC;
}
void InitDocStruct( DOCINFO* di, char* docname)
{
// Always zero it before using it.
memset( di, 0, sizeof( DOCINFO ) );
// Fill in the required members.
di->cbSize = sizeof( DOCINFO );
di->lpszDocName = "test";
}
HINSTANCE hInstance;
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
hInstance = (HINSTANCE)hModule;
return TRUE;
}
extern "C" DllExport void ufusr( char *parm, int *returnCode, int rlen )
{
int nErr = 0;
HWND hWnd = NULL;
HDC hDC;
DOCINFO di;
nErr = UF_initialize();
if (nErr != 0)
{
uc1601 ("Failed to initialise UG session", 1);
return;
}
hWnd = GetActiveWindow();
if (hWnd != NULL)
{
hDC = GetPrinterDC(hWnd);
if( !hDC)
{
MessageBox(NULL, "Error creating DC", "Error",
MB_APPLMODAL | MB_OK );
}
InitDocStruct( &di, "Test");
StartDoc( hDC, &di );
//// Print one page.
StartPage( hDC );
//DrawStuff( hDC );
EndPage( hDC );
//// Indicate end of document.
EndDoc( hDC );
// Clean up
DeleteDC( hDC );
}
nErr = UF_terminate();
}
|
|
|
|
|
Hello ppl,
I have been trying to add Flex Grid to my MFC application in VS 2005. Actually I have added the ocx control but I cannot create it's class.
When I enter Object Browser and choose fles grid ocx and click Add Reference button it gives me an error that the ocx is not in my reference path.
How do I create it's h and cpp file of ocx and use it in my MFC application?
Thanx....
|
|
|
|
|
Seems like I have sold my problem.......
OK First we add a class to our dialog...
after that we can add a variable to our Flex Grid object.. When you do that, adding variable dialog ahs two textboxes at bottom which asks for wrapper class for ocx, you just enter the name oh .h and .cpp file, VS handles it for you..
|
|
|
|
|
Hi,
I am working on mfc and my application has chat module in which i wanat to send file through server.
I have been able to select the file to be send. I need to know what to do after I select the path of the sile to be send.
Please help me.
Thanks In Advance.
Dhiraj Kumar Ssaini
|
|
|
|
|
Open a TCP/IP connection through two users which are sender and reciever.
Sender should open the selected file in binary mode read it and write it through socket. And reciever should read incoming data from socket and write it to it's local file.
Server should be used only to connect these together. You should not send file through server, cause it costs too much and unneccesarry...
|
|
|
|