Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to link one .exe to another .exe in C++
    primarykey
    data
    text
    <p>I have two <code>.exe</code>s. They need to use each other's functions at run times. One is dilogue based application <code>.exe</code> and other one is main application <code>.exe</code>. Now main application need to use dialog based applications function. But while compiling it could bot able to locate the existance of <code>called function</code> because unavailability of <code>dialog based applications .lib</code>. Because if i make dialog based application to <code>.lib</code>, then the program will fail at run time. So, I need to make call one <code>.exe</code> to other <code>.exe</code>. When I am trying call,</p> <pre><code> TestClass tc;/* Call dialog based application exe functions*/ tc.MyTest(); </code></pre> <p>It is throwing errors like</p> <pre><code>1&gt;CallExe.obj : error LNK2001: unresolved external symbol "public: __thiscall TestClass::~TestClass(void)" (??1TestClass@@QAE@XZ) 1&gt;CallExe.obj : error LNK2001: unresolved external symbol "public: void __thiscall TestClass::MyTest(void)" (?MyTest@TestClass@@QAEXXZ) 1&gt;CallExe.obj : error LNK2001: unresolved external symbol "public: __thiscall TestClass::TestClass(void)" (??0TestClass@@QAE@XZ) </code></pre> <p><code>Main application.cpp</code></p> <pre><code>int _tmain(int argc, _TCHAR* argv[]) { STARTUPINFO si; PROCESS_INFORMATION pi; TestClass tc;/* Call dialog based application exe functions*/ tc.MyTest(); // set the size of the structures ZeroMemory( &amp;si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &amp;pi, sizeof(pi) ); LPCTSTR szCmdline = (LPCTSTR)(TEXT("Dialog.exe")); // start the program up if(!CreateProcess(TEXT("D:\\Rasmi's\\Personal\\Visual Studio\\Dialog\\Debug\\Dialog.exe"), // the path argv[1], // Command line NULL, // Process handle not inheritable NULL, // Thread handle not inheritable FALSE, // Set handle inheritance to FALSE 0, // No creation flags NULL, // Use parent's environment block NULL, // Use parent's starting directory &amp;si, // Pointer to STARTUPINFO structure &amp;pi ) // Pointer to PROCESS_INFORMATION structure ) {cout &lt;&lt; "Unable to create\n";} // Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread ); return 0; } </code></pre> <p>In <code>Dialog.exe</code></p> <pre><code>TestClass::TestClass(void) { } TestClass::~TestClass(void) { } void TestClass::MyTest() { cout &lt;&lt; "This is my Test Class \n"; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload