|
Use the Error Lookup tool included with VC to find out what that error means: CoInitialize has not been called
|
|
|
|
|
I've noticed that, and I've called the CoInitialize(NULL); with the same result.
Which tool do you mean?
As always thank you in advance...
|
|
|
|
|
Tools->Error Lookup in the IDE, and it's in the VC6 start menu group too.
|
|
|
|
|
I can promise you that I've looked into the start menu... and I've not seen that...
I think that now it's time to go home and sleep a little bit...
the error that appears is: "Non registered class".
Any idea?
Thank you
|
|
|
|
|
Joan Murt wrote: I can promise you that I've looked into the start menu... and I've not seen that...
Goto your msdev installation directory
%MsDevDir%\Common\Tools\ERRLOOK.EXE
|
|
|
|
|
"Non Registered class" means the class is not registered ! lol
more seriously it's because the COM server implementing your CLSID hasnot registered in windows' registry
|
|
|
|
|
How should I register it? because I've been able to see it there...
Thank you in advance.
|
|
|
|
|
Where do you remove help files from make?
I added Express 2005 and now I have a conflict with VC 6.0 help files.
I just need to temporary remove it from build.
I cannot find it in Project .. Settings.
Thanks for reading
Vaclav
Here is the error I get after renaming the hlp directory in an attempt to stop making the help file.
Making help file...
hlp\X_FFT.hpj(1) : error:
The system cannot find the file specified.
Error executing c:\windows\system32\cmd.exe.
|
|
|
|
|
Select Dependencies from the Project menu.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Found it!
I had a wrong include path for afxhelp.hm and my ;Phack in renaming the directory acually masked the real error message.
|
|
|
|
|
Hi!
I have developed a VC++ Dll. This Dll resides in a common location accessible to 2-3 applications (VC++ applications). Can anyone please tell me how can i limit only one application to call the DLL at a time.
My requirement is only one VC++ application should load the DLL at the same time. No two applications should load the DLL at same time.
This is very urgent. Any help is greatly appreciated.
-- modified at 10:52 Thursday 19th April, 2007
|
|
|
|
|
That sounds odd. One of the primary advantages of using DLLs is that more than one application can use it at a time. Why do you want to do that?
|
|
|
|
|
My Dll communicates with external customised hardware and gets the data and the processed result is sent back to the client application.In the mean time if another application calls the same exported function of the dll, i will not be able send the accurate results(the hardware will not respond untill prevoius commands are serviced) to any of the client application.
|
|
|
|
|
You can use some info shared among DLL instances to prevent multiple processes to access the DLL functions at the same time. A quite similar problem was neatly addressed in this article [^] (see Code Details section).
Hope that helps.
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.
|
|
|
|
|
If it's an explicit load then wrap LoadLibrary with a named mutex.
If it's an implicit load then wrap all access points with one or more named muticies.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
i understand the logic.
Can you please send me some sample snippets if you have any? I have not worked on mutex yet and feeling difficult to understand from articles and MSDN.
My applications will be explicitly loading the Dll's.
So i understand i need to wrap the LoadLibraray() fnction in my Client application by mutex. But how will the other application know about this?
Mutex should be defined where?
|
|
|
|
|
Read: http://msdn2.microsoft.com/en-us/library/ms682411.aspx[^]
In your other reply you say it is one function you need to protect.
Something like this should work (you should add appropriate error checking):
void YOUR_EXPORT_API YourFunc ( void )
{
HANDLE mtx = CreateMutex(NULL, FALSE, "YourUniqueMutexName");
WaitForSingleObject(mtx, INFINITE);
ReleaseMutex(mtx);
CloseHandle(mtx);
}
If you can you may want to move the CreateMutex/CloseHandle code to the app init/term functions.
What happens in the above code is that the first app to call YourFunc creates a new mutex. Any other apps (or threads in the creating app) that call YourFunc will get a handle to the existing mutex when they call CreateMutex. After that the Wait function allows only one thread (across all apps) to execute the protected code at a time.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Thanks much for your help and Code!!
My problem is solved.
I read MSDN and learnt a new concept of using Mutex!!
Thanks again!!
|
|
|
|
|
Hello,
how to to get information about how many disk is available,
and about all partitions if there more then one!?
What functions to use for that?
regards
termal
|
|
|
|
|
termal wrote: What functions to use for that?
How about GetDiskFreeSpace() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
thank you for your info, that is what i mean!
regards
termal
|
|
|
|
|
termal wrote: GetDiskFreeSpace
better use GetDiskFreeSpaceEx
"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,
thanks for info!
termal
|
|
|
|
|
Hi
I am using a Tab control in my project but when I change the color of dialog box a gray tab control seemed vary bad.How can I change the color of tab control?I couldn't find this subject in my book and also my knowledge is not enough to understand the articles about owner-drawn tab controls in this site.I do not want any gray area in my dialog box.How can I do that?And if you know where can I find a source about that subject in internet,please tell it to me.
Thanks
|
|
|
|
|
try to create your own class derived from CTabCtrl
then overload WM_ERASEBACKGROUND message
and in this message you can set the default background color of your control
|
|
|
|