|
They are already pointers.
But, Thanks for the reply
I lOVE CP. Always gets so many tips and suggestions.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
|
Hi,
I have a Visual C++ MFC Dialog based application. And I would like to include a .c and .h file in the project.
When I tried to compile this project I had the following error:
Unexpected end of file while looking for precompiled header directive, fatal error C1010.
If anyone could help me with regards including c-code files in my project.
Thanking you in anticipation
|
|
|
|
|
You need to use automatic use of precompliled headers. Select project/settings (or ALT+F7) then, in the Project Settings Dialog, select the C/C++ tab, then select the Precompiled Headers item in the combo box, and select the Automatic use of precompliled headers option.
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
The project has set the c file to use a precompiled header (through stdafx.h).
Since the c file doesn't have an #include "stdafx.h" the compiler gets an error searching for it.
You just need to turn this option off for the file, through the file properties.
Hope this helps,
Lan
|
|
|
|
|
also #include the "stdafx.h" file inside your c file.
Or turn off the use of precompiled headers.
|
|
|
|
|
It's working, thank you all!!!
|
|
|
|
|
Hi,
Is it possile to tell VC++ that I wish to save all debug file to ONE directory. I dont like deleting this files from Debug directories . Id like to delete only one with all files !!
Wiizi
|
|
|
|
|
You can delete the files, using the menu item Clear....
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Where is it ? I cannot find this :/
Wiizi
|
|
|
|
|
i guess he wanted to say Clean, its under build menu
but i prefer to find every "debug" using the find files or folder then CTRL + A then SHIFT + DELETE!
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
He probably means Clean. UNder the Build menu look for Clean. It shoudl be in there.
Regards,
Brian Dela
|
|
|
|
|
I'm sorry, it's Build/Clean....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Is the windows message queue thread safe? That is, can I have two threads using PostMessage() into a windows message pump?
J
|
|
|
|
|
jamiehale wrote:
can I have two threads using PostMessage() into a windows message pump?
Yes. Just remember that thread can have its own message queue. Are your threads queue-less (worker threads) or do they have one (UI threads)?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
I'm trying to decide if I can use my main thread (dialog app) to process asynchronous messages from clients, or if I need to start another thread to handle them. I was curious as to whether or not it would be safe to have another thread posting messages to the main thread - or alternatively, several threads posting to a message queue in yet another thread.
I think, regardless, I'm going to start another thread and build my own message pump (custom, not windows) simply because of the nature of the app...
J
|
|
|
|
|
In
_ClRemoteButton p;
p.CreateDispatch("DllwithForm.Class1");
p.CheckingPB(CMHandle,0,500);
AfxMessageBox ("back from dll");
CheckingPB is a function in a dll and it Sendmessages (not Postmessages) say 100 times in a loop.
When does the messagebox fire? After the function returns? Or as soon as I have called
p.CheckingPB(CMHandle,0,500);
, the code advances to the messagebox? I dont have any threads or anything.
Will I get the 100 messages before the messagebox? I cant really tell in my sample and need to know for sure..
Thanks,
ns
|
|
|
|
|
You have coded:
p.CheckingPB(CMHandle,0,500);
AfxMessageBox ("back from dll");
So AfxMessageBox() is called after CheckingPB() has returned.
And as you have used SendMessage() your messages, you can be sure that they have been handled when the messagebox fires.
|
|
|
|
|
So I dont need to send a message from the dll saying its done! It'll do all its stuff , and then after that the code carries on. THis is good news!
Thanks,
ns
|
|
|
|
|
Correct.
However, if you'd used PostMessage , a hundred messages would be posted, the function would return, the message box would fire, and when Windows got a chance to (eventually) pump its message queue, the 100 posted messages would be handled.
So you're doing the right thing by using SendMessage .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
My progressCtrl needs to be cleared or hidden away after its done. I dont see any function that will do it in that class. Also is it possible to send a message with Sendmessage that will clear the ctrl?
I am sending PBM_STEPIT messages from a dll, and am wondering how to notify the control that the operation is finished. I cant set the range before hand so it cycles through a few times. Any ideas on how one would notify it that the process in the remote dll is done ? Basically each time the dll function steps through a for loop, it sends off a PBM_STEPIT to the calling apps progressbar. At the end of the loop the progressbar needs to know all is done, and magically clear or vanish.
Appreciate any ideas..
Thanks,
ns
|
|
|
|
|
ns wrote:
I cant set the range before hand
If you can't know how long your task will take beforehand, maybe a CProgressCtrl is not the right control to display its working state? Would a flashing 'LED'-type button not be better to signal 'Process still running'?
ns wrote:
Any ideas on how one would notify it that the process in the remote dll is done
Your thread could send your CProgressCtrl -derived class a message (WM_APP+x or a Registered WM), on which it is set to 100%, a Timer is started and OnTimer disposes the CProgressCtrl .
|
|
|
|
|
Flashing button _ I've never seen that! So it toggles from red to grey or something?
Still trying to make the control clear when done. I'm also trying to absorb the timer idea - need to read about...
Thanks,
ns
|
|
|
|
|
ns wrote:
Flashing button _ I've never seen that! So it toggles from red to grey or something?
I have made this once - From my task, I sent a message whose handler simply did blit a gey and a blue bitmap alternating to the same position on the screen. When the task was completed, I blitted background color there.
You could easily spend any amount of time with improving and beautifying and things like that, but at that time I specifically did not want to have a button flashing beautiful, but to show progress by alternating colors.
|
|
|
|
|
Simply hide the progress control when it's no longer required.
GetDlgItem (IDC_ProgressCtrl)->ShowWindow (SW_HIDE);
Be sure to show it (use SW_SHOW ) just before you need it.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|