|
You really should supply more relevant information if you want useful help in solving your problem. Most people do not like playing "twenty questions" just to get enough information to help.
When the linker generates LNK2019 it gives you more info, what is the information given?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Sorry, Because my system is chinese version and this is my first time to ask question in web site, that's why I didn't provide more information. I checked this error message from MSDN web site.
LNK2019 : unresolved external symbol 'symbol' referenced in function 'function'
SimpleMCMain1 error LNK2019: 無法在外部之程式庫中找到或連結所需之資料型別或函式的符號 _main,於函式 _mainCRTStartup 中參考
LNK1120 : number unresolved externals
SimpleMCMain1 fatal error LNK1120: 1 個無法在外部程式庫中找到或連結所需之資料型別或函式
|
|
|
|
|
What is SimpleMCMain1 ? It's not shown anywhere in your code.
Are you creating a CRT application? The LNK2019 linker error might be resolved by changing "Minimize CRT Use in ATL" to "No". Go to Project Properties / Configuration Properties / General. Does that help?
"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
|
|
|
|
|
The application that I am currently developing is attempting to programmatically control an external application by simulating mouse clicks in it's various windows. I have managed to produce the context menu on the external application by simulating a RH mouse click (using PostMessage's with WM_RBUTTONDOWN / WM_RBUTTONUP). I can also execute an item on the popup menu by positioning the cursor and simulating a LH mouse click (using PostMessage's with WM_LBUTTONDOWN / WM_LBUTTONUP). This all works as expected if there is no other code following it (i.e. my app exits) or there is an AfxMessageBox separating this code and further mouse-click simulations. The failure is that execution of the popup menu item doesn't result in a new window. I get the feeling that the external app is not getting 'time' to receive/react to the simulated clicks until my app exits (Presumably, the AfxMessageBox must also have the same effect - yes ?). I have tried Sleep(10000) after the context menu operation, but this doesn't seem to help. Do I need to (somehow) inform the system that my app doesn't need the remainder of it's current timeslot, thus giving the external app time to "do its stuff". If so, how do I do that ?
Doug
|
|
|
|
|
Does the blocking SendMessage(...) instead og PostMessage help?
Vipin - MVP
|
|
|
|
|
Tried SendMessage originally, and couldn't even get the initial stages to work. I have currently got this stuff implemented in InitDialog() of a dialog-based app - and I was in error in my original posting when I said that it only worked when my app exited - I should have said that it only worked once the DoModal() had executed. Is this a clue ??
Doug
|
|
|
|
|
Assuming you can get the process handle (if your app launched the other app with ::CreateProcess(), for instance), after posting the mouseclick message, try using ::WaitForInputIdle(processHandle, timetowait) like so:
bool bIdle = false;
DWORD dwWaitResult;
dwWaitResult = ::WaitForInputIdle(hProcess, 5000);
switch (dwWaitResult)
{
case 0 :
{
bIdle = true;
}
break;
case WAIT_TIMEOUT :
{
AfxMessageBox("Timed out waiting for idle state.");
}
break;
case WAIT_FAILED :
{
}
break;
}
------- 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
-- modified at 9:00 Sunday 8th January, 2006
|
|
|
|
|
Hi John and VIP ! Thanks for your input - in the meantime, I seem to have solved the (current !) problem - putting my code in InitDialog() seems to be the wrong place. Thinking about it, I suspect that the message loop (pump) is not activated until window initialisation has been completed. I've moved my code into InitInstance() (and actually removed the main window dialog and DoModal() as I currently don't need it !) and everything now works !!! Thanks again ! Perhaps someone can confirm my suspicions about the message loop and InitDialog() - might help someone else in the future !
Doug
|
|
|
|
|
|
|
You need to make composite activex control.
-Prakash
|
|
|
|
|
i am previously ask this question before but i have relise taht my previous question was not easy to understand.
can any one please teach me how i can pass a object to a function using pointers?
this is normally how i pass a normal variable to a function using a pointer:
<br />
void function(int* ptr)<br />
int main()<br />
{<br />
int num1;<br />
function(&num1);<br />
<br />
return 0;<br />
}<br />
wat i wanan do now is something like this:
<br />
class theclass<br />
{<br />
public:<br />
<br />
}<br />
void function(theclass* ptr)<br />
<br />
int main()<br />
{<br />
theclass tc;<br />
function(&tc);<br />
<br />
return 0;<br />
}<br />
so what i am trying to do is replacing the int with the object but it have error so could any one please teach me how to do this??
i will greatly appreciated it![Rose | [Rose]](https://codeproject.freetls.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
What is the error that you are getting ?
-Prakash
|
|
|
|
|
this is part of my actual code:
<br />
void add_new_item(grahpic_card* gc_add);<br />
<br />
int main()<br />
{<br />
graphic_card gc;<br />
add_new_item(&gc);<br />
}<br />
:\Documents and Settings\nick\Desktop\lalabear project\newporject.cpp(128) : error C2065: 'grahpic_card' : undeclared identifier
C:\Documents and Settings\nick\Desktop\lalabear project\newporject.cpp(128) : error C2065: 'gc_add' : undeclared identifier
C:\Documents and Settings\nick\Desktop\lalabear project\newporject.cpp(128) : error C2182: 'add_new_item' : illegal use of type 'void'
C:\Documents and Settings\nick\Desktop\lalabear project\newporject.cpp(160) : error C2064: term does not evaluate to a function
C:\Documents and Settings\nick\Desktop\lalabear project\newporject.cpp(181) : error C2448: '<unknown>' : function-style initializer appears to be a function definition
|
|
|
|
|
neodeaths wrote: :\Documents and Settings\nick\Desktop\lalabear project\newporject.cpp(128) : error C2065: 'grahpic_card' : undeclared identifier
neodeaths wrote: graphic_card gc;
are you sure ur class name is graphic_card and not grahpic_card (spelling mistake)
-Prakash
-- modified at 11:10 Saturday 7th January, 2006
|
|
|
|
|
wow your rite!
it works now!!
thank you for your help
|
|
|
|
|
You beat me to it!
Kevin
|
|
|
|
|
your suggestion of reference is good too but then i thought fixing his compiler error was first thing to do.
-Prakash
|
|
|
|
|
-Prakash
|
|
|
|
|
You're just a victim of people (and I use that term very loosely) that have a thick single eyebrow running across their severely sloped foreheads. These individuals are also open-mouth breathers that walk around with a stupid grin on their faces and drool running out of one corner of their mouth. Their IQ is typically "1", just like the votes they cast...
------- 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
|
|
|
|
|
Mellowing out these days John? By the way, I agree with you and a way to track those who have voted you a 1 would be nice.
The tigress is here 
|
|
|
|
|
I had suggested that a mail be send to the poster whose message was voted with info like who voted it and with what, but not many ppl liked it.
-Prakash
|
|
|
|
|
Yep. Notice I didn't call them "dim-witted mother f***ers"?
I don't care who votes 1's on my messages - let them wallow in their false sense of power for all I care. What I care about is the morons that vote *articles* based on politics instead of the content of the article.
BTW, how are ya? Haven't seen you post in a while.
------- 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
|
|
|
|
|
Mr.Prakash wrote:
thats common!
"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
|
|
|
|
|
ThatsAlok wrote: thats common!
really, so voting down a message where i helped that guy is common? who does that?
-Prakash
|
|
|
|