Hi All, I have a makefile project and I want to call COM (ActiveX control) in the project. The code to call COM in makefile is as follows: Files included for COM support are: #include #include #include #include #include //I am just putting the COM calling code let me know if I m doing the right way. HRESULT hr = CoInitialize(NULL); if(FAILED(hr)) { printf("CoInitialize Failed\n"); return 0; } IMyInterface* pInt = NULL; hr = CoCreateInstance(CLSID_MyInterface, NULL, CLSCTX_INPROC_SERVER, IID_IMyInterface, reinterpret_cast (&pInt)); if(SUCCEEDED(hr)) pInt->Connect(); //This is the COM funtion that I want to use pInt->Release(); CoUninitialize(); It compiles fine but when I try to build it gives me Linking Error... MyClass.OBJ : error LNK2001: unresolved external symbol __imp__CoUninitialize@0 MyClass.OBJ : error LNK2001: unresolved external symbol __imp__CoCreateInstance@20 MyClass.OBJ : error LNK2001: unresolved external symbol __imp__CoInitialize@4 MyApplication.EXE : fatal error LNK1120: 3 unresolved externals NMAKE : fatal error U1077: 'link' : return code '0x460' Please help me on this. Thanks in advance. Ashok
ashok123
Posts
-
How can I call COM from MakeFile Project in C++ -
Why Error???Thanks Chris...:-D
-
Why Error???I am not sure why I am getting error in displaying the output. I want output such that when I enter a string aaaabaaba... for "aaa" it shud give output 0 and "aba" it should give output 1. I am not sure where the error is??? Please help thanks is advance. #include #include #include #include char* in; void main() { cout << "Enter your string here \n"; cin>>in; while(*in != ' ') //it crashes here { if(strncmp(in, "aaa", 3)==0) cout << "0"; if(strncmp(in, "aba", 3)==0) cout << "1"; in+=3; } } A
-
ActiveX and Windows C++Hello, I am working on a project and I am stuck at one place. I have 2 applications. 1-> ActiveX Control (Developed in MFC) 2-> A Windows C++ application.(No MFC...purely Windows) How can I use the functions defined in ActiveX into this C++ application. I tried adding the ActiveX header file in my C++ application but then I get an error of CWnd, CString etc classes of MFC not found. Please let me know if you or any of your friends know the solution. Please email me at dubeyashok@yahoo.com Thanks in Advance. Ashok Dubey Ashok
-
ActiveX and Windows C++Hello, I am working on a project and I am stuck at one place. I have 2 applications. 1-> ActiveX Control (Developed in MFC) 2-> A Windows C++ application.(No MFC...purely Windows) How can I use the functions defined in ActiveX into this C++ application. I tried adding the ActiveX header file in my C++ application but then I get an error of CWnd, CString etc classes of MFC not found. Please let me know if you or any of your friends know the solution. Please email me at dubeyashok@yahoo.com Thanks in Advance. Ashok Dubey Ashok