|
I am programming with the API of Autodesk Inventor, which is a CAD software. so the calling of the clipboard functionality is hidden behind those API function.
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
But are you actually redrawing the device context that holds the pasted sketch? Maybe it's being pasted but you're just not re-drawing it.
Kelly Ryan
|
|
|
|
|
KellyR wrote: But are you actually redrawing the device context that holds the pasted sketch? Maybe it's being pasted but you're just not re-drawing it.
What WM_TIMER Message and SetTimer api
"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
|
|
|
|
|
sorry ,I don't quite understand what you said.
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
|
I am just calling the command provided by the Autodesk Inventor and I can't got the state infomation of the device context.
In addition. I can get the relative objects through API if the paste succeeds, but I got nothing, indicating that the paste failed
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
More detail would help, but if I had to guess:
It works with the AfxMessageBox call but not with the Sleep call. This suggests the operation needs a message pump running.
Steve
|
|
|
|
|
yes, it is quite ture that It works with the AfxMessageBox call but not with the Sleep call.
what detail do I need to provide?
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
I need more details on the implementation of the methods you're calling.
Steve
|
|
|
|
|
these methods are all provided by the API and no implementation is availalbe.
I just know that a message box has to be inserted.
Thank you very much!!!
-------------------
I am learning C++ and English
-- modified at 22:56 Monday 9th January, 2006
|
|
|
|
|
Is there any documentation for these methods that describe the environment needed by them?
Steve
|
|
|
|
|
Try code like this (instead of the AfxMessageBox call - since a message pump seems to be required):
UINT TimerId = SetTimer(NULL, 0, 5000, NULL);
MSG m;
BOOL bOk;
while ( (bOk=GetMessage(&m, NULL, 0, 0)) && bOk!=-1 )
{
DispatchMessage(&m);
if ( m.message==WM_TIMER && m.wParam==TimerId )
{
break;
}
}
KillTimer(NULL, TimerId);
Caveat:
I don't really know what's going on or what you’re trying to do or the over all structure of your program so this is just a guess. I have hard coded a 5 second delay. You will be able to use the UI of the app during this time - You may want to simulate modality by putting a call to disable the main app window before and another to re-enable it after. 9 times out of 10, when you put a hard coded delay in a program your doing the wrong thing: How long do you wait? Will this be long enough on a slower machine? If you wait long enough for a slow machine are you "cheating" users with fast machines?
Steve
|
|
|
|
|
these codes are to be put into a function in a class which is derived from a MFC class CDialog.
so when I copy the codes you provided, following errors occur:
error C2660: 'SetTimer' : function does not take 4 parameters<br />
error C2660: 'KillTimer' : function does not take 2 parameters
and I don't know how to call the two functions SetTimer and KillTimer of API version while there exists CWnd::SetTimer and CWnd::KillTimer
I don't much about these functions, so could you please tell me how do it?
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
Put a "::" (two colons) in front of the effected functions. This will tell the compiler to use the global versions and not the member functions of the same name.
ie.
::SetTimer and ::KillTimer
Steve
|
|
|
|
|
thank you, Stephen Hewitt, I appreciate your help so much.
it works finally with your help!
in fact, it dosen't matter how long the time delay is set to be. I set it one milisecond, it works too
thanks a lot to all the other guys.
-------------------
I am learning C++ and English
-- modified at 2:09 Tuesday 10th January, 2006
|
|
|
|
|
ewighell wrote: in fact, it dosen't matter how long the time delay is set to be. I set it one milisecond, it works too
In that case you could try code like the following:
MSG m;
while ( PeekMessage(&m, NULL, 0, 0, PM_REMOVE) )
{
DispatchMessage(&m);
}
This is simpler. It dispatches all the messages in the message que then continues on - And no time delay.
Steve
-- modified at 2:48 Tuesday 10th January, 2006
|
|
|
|
|
EXTEIDE is freeware. Anyone can download now.
Please visit http://www.exteide.com
Thanks.
|
|
|
|
|
Please read #7 here.
About all you've managed to do with your post is keep folks here at CP from downloading it.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Please read #7 here.
Hm, at least "EXTEIDE is freeware". It's an announcement rather than advertising or soliciting.
|
|
|
|
|
Roland Pibinger wrote: Hm, at least "EXTEIDE is freeware". It's an announcement rather than advertising or soliciting.
not in VC++ forum.
-Prakash
|
|
|
|
|
This forum is for posting C++ questions, not advertising software.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
And you have made sure people don't trust that site with the way you have acted.
The tigress is here
|
|
|
|
|
For some reason, I cant get any simple program, using
the new visual studio 2005, to compile if it has a CString
as a variable or if I use #include <fstream>.
I am extremely perplexed. I know that CString is equivalent
to const char * and I guess I could use that, but I really
liked being able to use CString and am hoping I still can
somehow. Also, if I want to open an ascii file and close
it, I use the #include <fstream> header, but I keep getting
an error with that line.
Any ideas?? Please, any response any one can give me will
be greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
DanYELL wrote: For some reason, I cant get any simple program...to compile...
DanYELL wrote: ...but I keep getting
an error with that line.
Why? What errors are you receiving?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Here is a common error I get using CString:
error C2664: 'strcpy' : cannot convert parameter 2 from
'CString' to 'const char *'
I use to pass a CString, but it doesnt recognize CString
anymore. If I pass const char *, it works?
If I type #include <fstream.h>, I get:
fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory
If I type #include <fstream>, I get more errors.
So Im stumped. Its a very simple program that compiles in
Visual C++ 6.0, but using Visual Studio 2005, I get errors that
I cant seem to get past.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|