convertion vc6 to dotnet2008
-
I've just had a look at an ATL project I've got. The CLSID for my class is defined in my equivalent of ABC_i.c - is that file (ABC_i.c) being compiled and linked in your project?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
i dont know much more abt this vc++.. how do i link my class to this ABC_i.c i need to give any reference or any alternate methord..?? After compiling...ABC_i.c is generating...with out my CLSID of my class
-
i dont know much more abt this vc++.. how do i link my class to this ABC_i.c i need to give any reference or any alternate methord..?? After compiling...ABC_i.c is generating...with out my CLSID of my class
Right-click on ABC_i.c in Solution Explorer and select Properties. Under Configuration Properties->General, the 'Excluded from Build' property should be set to 'No'. Now rebuild the project. At some point, in the output window, you should see mention of ABC_i.c - that means it is being compiled. Hopefully the project will automatically link with ABC_i.c - if it doesn't, I'm not sure why....
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Right-click on ABC_i.c in Solution Explorer and select Properties. Under Configuration Properties->General, the 'Excluded from Build' property should be set to 'No'. Now rebuild the project. At some point, in the output window, you should see mention of ABC_i.c - that means it is being compiled. Hopefully the project will automatically link with ABC_i.c - if it doesn't, I'm not sure why....
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
there is no luck for me... //====================================================================================== /* this ALWAYS GENERATED file contains the definitions for the interfaces */ /* File created by MIDL compiler version 7.00.0500 */ /* at Sat Apr 18 14:23:13 2009 */ /* Compiler settings for .\AppFast.idl: Oicf, W1, Zp8, env=Win32 (32b run) protocol : dce , ms_ext, c_ext, robust error checks: stub_data VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ //@@MIDL_FILE_HEADING( ) #pragma warning( disable: 4049 ) /* more than 64k source lines */ /* verify that the version is high enough to compile this file*/ #ifndef __REQUIRED_RPCNDR_H_VERSION__ #define __REQUIRED_RPCNDR_H_VERSION__ 475 #endif #include "rpc.h" #include "rpcndr.h" #ifndef __RPCNDR_H_VERSION__ #error this stub requires an updated version of #endif // __RPCNDR_H_VERSION__ #ifndef __ABC_i_h__ #define __ABC_i_h__ #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once #endif /* Forward Declarations */ /* header files for imported files */ #include "oaidl.h" #include "ocidl.h" #ifdef __cplusplus extern "C"{ #endif #ifndef __ABCLib_LIBRARY_DEFINED__ #define __ABCLib_LIBRARY_DEFINED__ /* library ABCLib */ /* [helpstring][version][uuid] */ EXTERN_C const IID LIBID_ABCLib; #endif /* __ABCLib_LIBRARY_DEFINED__ */ /* Additional Prototypes for ALL interfaces */ /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif //====================================================================================== this is my generated ABC_i.c.... After this code
EXTERN_C const IID LIBID_ABCLib;
i need to add want to add this code...EXTERN_C const CLSID CLSID_ABCPP;
#ifdef __cplusplus
class DECLSPEC_UUID("D85DDEB0-0354-44A0-842C-D264885B8A92")
ABCPP;
#endifis it possible....Please ... Regards Rajeesh
-
there is no luck for me... //====================================================================================== /* this ALWAYS GENERATED file contains the definitions for the interfaces */ /* File created by MIDL compiler version 7.00.0500 */ /* at Sat Apr 18 14:23:13 2009 */ /* Compiler settings for .\AppFast.idl: Oicf, W1, Zp8, env=Win32 (32b run) protocol : dce , ms_ext, c_ext, robust error checks: stub_data VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ //@@MIDL_FILE_HEADING( ) #pragma warning( disable: 4049 ) /* more than 64k source lines */ /* verify that the version is high enough to compile this file*/ #ifndef __REQUIRED_RPCNDR_H_VERSION__ #define __REQUIRED_RPCNDR_H_VERSION__ 475 #endif #include "rpc.h" #include "rpcndr.h" #ifndef __RPCNDR_H_VERSION__ #error this stub requires an updated version of #endif // __RPCNDR_H_VERSION__ #ifndef __ABC_i_h__ #define __ABC_i_h__ #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once #endif /* Forward Declarations */ /* header files for imported files */ #include "oaidl.h" #include "ocidl.h" #ifdef __cplusplus extern "C"{ #endif #ifndef __ABCLib_LIBRARY_DEFINED__ #define __ABCLib_LIBRARY_DEFINED__ /* library ABCLib */ /* [helpstring][version][uuid] */ EXTERN_C const IID LIBID_ABCLib; #endif /* __ABCLib_LIBRARY_DEFINED__ */ /* Additional Prototypes for ALL interfaces */ /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif //====================================================================================== this is my generated ABC_i.c.... After this code
EXTERN_C const IID LIBID_ABCLib;
i need to add want to add this code...EXTERN_C const CLSID CLSID_ABCPP;
#ifdef __cplusplus
class DECLSPEC_UUID("D85DDEB0-0354-44A0-842C-D264885B8A92")
ABCPP;
#endifis it possible....Please ... Regards Rajeesh
See, you've confused me now. First you have a linker error, which means that CLSID_ABC was declared in the header, but not defined anywhere. Now you're saying you need to add some code into the header...now, that's not going to help with your linker errors at all.
Rajeesh MP wrote:
this is my generated ABC_i.c....
Also - you didn't actually post your ABC_i.c file.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
See, you've confused me now. First you have a linker error, which means that CLSID_ABC was declared in the header, but not defined anywhere. Now you're saying you need to add some code into the header...now, that's not going to help with your linker errors at all.
Rajeesh MP wrote:
this is my generated ABC_i.c....
Also - you didn't actually post your ABC_i.c file.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
no dear... i will explain u very simply..... if i am adding a class to my ATL application...that class id will generate automatically in our ABC_i.h.... but i m trying to add my existing file to my application...After compiling time this existing CLASSID is not generating in our ABC_i.h so my question after adding this excisting ABC.cpp i need do something in our application settings..for generating this classid.. Regards Raj
-
no dear... i will explain u very simply..... if i am adding a class to my ATL application...that class id will generate automatically in our ABC_i.h.... but i m trying to add my existing file to my application...After compiling time this existing CLASSID is not generating in our ABC_i.h so my question after adding this excisting ABC.cpp i need do something in our application settings..for generating this classid.. Regards Raj
Rajeesh MP wrote:
if i am adding a class to my ATL application...that class id will generate automatically in our ABC_i.h....
Fine - we agree on that :-)
Rajeesh MP wrote:
but i m trying to add my existing file to my application...After compiling time this existing CLASSID is not generating in our ABC_i.h
By 'existing file', I presume you mean the IDL file that contains that class and interface definition? Or not?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Rajeesh MP wrote:
if i am adding a class to my ATL application...that class id will generate automatically in our ABC_i.h....
Fine - we agree on that :-)
Rajeesh MP wrote:
but i m trying to add my existing file to my application...After compiling time this existing CLASSID is not generating in our ABC_i.h
By 'existing file', I presume you mean the IDL file that contains that class and interface definition? Or not?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Good MOrning...Stuart NO...directly i m adding ABCD.cpp and ABCD.h file why..there is no other post...??only we are here...ha ha ha Mr.Staurt ..can u add me on ur personel mail... my id rajeeshmp@gmail.com Regards, Rajeesh MP
modified on Wednesday, April 22, 2009 12:16 AM
-
Good MOrning...Stuart NO...directly i m adding ABCD.cpp and ABCD.h file why..there is no other post...??only we are here...ha ha ha Mr.Staurt ..can u add me on ur personel mail... my id rajeeshmp@gmail.com Regards, Rajeesh MP
modified on Wednesday, April 22, 2009 12:16 AM
Rajeesh MP wrote:
NO...directly i m adding ABCD.cpp and ABCD.h file
OK - finally, I think I'm clear on why you're having these problems :-) So...let me tell you what I've done and let's see if that helps. I first created an ActiveX project called "ax-ctrl", with a simple ActiveX object called "test". That built fine. It contained files test.h and test.cpp (for the object) and axctrl_i.c and axctrl_i.h (for the ActiveX library). I then created another ActiveX project called "ax-copy" and added test.cpp and test.h to that without moving them from the existing project. When I built that project, it complained about missing symbols like this:
3>test.obj : error LNK2001: unresolved external symbol _IID_Itest
3>test.obj : error LNK2001: unresolved external symbol _LIBID_axctrlLibI then added axctrl_i.c to the ax-copy project and (after telling it not to use precompiled headers) it worked fine.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Rajeesh MP wrote:
NO...directly i m adding ABCD.cpp and ABCD.h file
OK - finally, I think I'm clear on why you're having these problems :-) So...let me tell you what I've done and let's see if that helps. I first created an ActiveX project called "ax-ctrl", with a simple ActiveX object called "test". That built fine. It contained files test.h and test.cpp (for the object) and axctrl_i.c and axctrl_i.h (for the ActiveX library). I then created another ActiveX project called "ax-copy" and added test.cpp and test.h to that without moving them from the existing project. When I built that project, it complained about missing symbols like this:
3>test.obj : error LNK2001: unresolved external symbol _IID_Itest
3>test.obj : error LNK2001: unresolved external symbol _LIBID_axctrlLibI then added axctrl_i.c to the ax-copy project and (after telling it not to use precompiled headers) it worked fine.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Ha Ha Ha... my application is working same way only... before posting this message...i done this..and its working fine... but i would like to know any alternate trik is there or not..like adding reference or linking....etc Thank u Stuart Rajeesh MP
-
Ha Ha Ha... my application is working same way only... before posting this message...i done this..and its working fine... but i would like to know any alternate trik is there or not..like adding reference or linking....etc Thank u Stuart Rajeesh MP
Good Morning Mr.Stuart :) if i m creating a dll with ATl dotnet2008. that we can register in regscr 32 /i "dll path"...am i right..???:confused: my old c++ application like this (ABC.cpp)
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ABCD, CABCD)
END_OBJECT_MAP()/////////////////////////////////////////////////////////////////////////////
// DLL Entry Pointextern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
_Module.Init(ObjectMap, hInstance, &LIBID_ABCLib);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE; // ok
}but now i m converting this to new application with ATL dotnet2008. ;P so in my dllmain.cpp contains :-\
CABCModule _AtlModule;
//DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
hInstance;
return _AtlModule.DllMain(dwReason, lpReserved);
}and ABCD.h contains :doh:
OBJECT_ENTRY_AUTO(__uuidof(ABCD), CABCD)
My new ATL appliation is successfully succeeded.. regscr 32 /i "dll path" i can register like this..no error:rose: After registering my AIM is not getting..its not working.. :zzz: i m feeling this above code conversion is not proper.. so mr.Stuart please :laugh: check this code and let me know.. Thanks Rajeesh MP
-
Ha Ha Ha... my application is working same way only... before posting this message...i done this..and its working fine... but i would like to know any alternate trik is there or not..like adding reference or linking....etc Thank u Stuart Rajeesh MP
Rajeesh MP wrote:
but i would like to know any alternate trik is there or not..like adding reference or linking
Not really - building the UUID directly into the code is hte best way.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Good Morning Mr.Stuart :) if i m creating a dll with ATl dotnet2008. that we can register in regscr 32 /i "dll path"...am i right..???:confused: my old c++ application like this (ABC.cpp)
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ABCD, CABCD)
END_OBJECT_MAP()/////////////////////////////////////////////////////////////////////////////
// DLL Entry Pointextern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
_Module.Init(ObjectMap, hInstance, &LIBID_ABCLib);
DisableThreadLibraryCalls(hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
_Module.Term();
return TRUE; // ok
}but now i m converting this to new application with ATL dotnet2008. ;P so in my dllmain.cpp contains :-\
CABCModule _AtlModule;
//DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
hInstance;
return _AtlModule.DllMain(dwReason, lpReserved);
}and ABCD.h contains :doh:
OBJECT_ENTRY_AUTO(__uuidof(ABCD), CABCD)
My new ATL appliation is successfully succeeded.. regscr 32 /i "dll path" i can register like this..no error:rose: After registering my AIM is not getting..its not working.. :zzz: i m feeling this above code conversion is not proper.. so mr.Stuart please :laugh: check this code and let me know.. Thanks Rajeesh MP
Rajeesh MP wrote:
so in my dllmain.cpp contains
DllMain doesn't really matter - when regsvr32 registers a control, it calls DllRegisterServer, which you should find in one of your other cpp files.
Rajeesh MP wrote:
After registering my AIM is not getting
AIM? As in messaging?
Rajeesh MP wrote:
i m feeling this above code conversion is not proper..
If it's ATL generated code, then I'm confident it's OK. The issue is more likely to be with the control registration data (the rgs files). Check that the CLSIDs and paths in those are OK Then you can open the registry (with regedit) and check that the registration in there is OK.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Rajeesh MP wrote:
but i would like to know any alternate trik is there or not..like adding reference or linking
Not really - building the UUID directly into the code is hte best way.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
HI..Stuart My ATL 2008 application dllmain is contains
CABCModule _AtlModule;
abc.cpp is having
STDAPI DllRegisterServer(void)
{
// registers object, typelib and all interfaces in typelib
HRESULT hr = _AtlModule.DllRegisterServer();
return hr;
}// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
HRESULT hr = _AtlModule.DllUnregisterServer();
return hr;
}but my old application is
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ABCPP, CABCPP)
END_OBJECT_MAP()STDAPI DllRegisterServer(void)
{
// registers object, typelib and all interfaces in typelib
return _Module.RegisterServer(TRUE);
}/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registrySTDAPI DllUnregisterServer(void)
{
return _Module.UnregisterServer(TRUE);
}any difference is there this two codes..?? what s the difference b/w ... CABCModule _AtlModule; and CComModule _Module;:confused: i think becouse of this my dll is not working properly.. :zzz: how do i create CComModule _Module; project..in ATL dotnet2008..:confused: Regards Rajeesh MP
-
HI..Stuart My ATL 2008 application dllmain is contains
CABCModule _AtlModule;
abc.cpp is having
STDAPI DllRegisterServer(void)
{
// registers object, typelib and all interfaces in typelib
HRESULT hr = _AtlModule.DllRegisterServer();
return hr;
}// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
HRESULT hr = _AtlModule.DllUnregisterServer();
return hr;
}but my old application is
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ABCPP, CABCPP)
END_OBJECT_MAP()STDAPI DllRegisterServer(void)
{
// registers object, typelib and all interfaces in typelib
return _Module.RegisterServer(TRUE);
}/////////////////////////////////////////////////////////////////////////////
// DllUnregisterServer - Removes entries from the system registrySTDAPI DllUnregisterServer(void)
{
return _Module.UnregisterServer(TRUE);
}any difference is there this two codes..?? what s the difference b/w ... CABCModule _AtlModule; and CComModule _Module;:confused: i think becouse of this my dll is not working properly.. :zzz: how do i create CComModule _Module; project..in ATL dotnet2008..:confused: Regards Rajeesh MP
Rajeesh MP wrote:
CABCModule _AtlModule; and CComModule _Module
The ATL module classes changed. Not a big deal.
Rajeesh MP wrote:
i think becouse of this my dll is not working properly
And why do you think your dll isn't working - what evidence do you have?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Rajeesh MP wrote:
CABCModule _AtlModule; and CComModule _Module
The ATL module classes changed. Not a big deal.
Rajeesh MP wrote:
i think becouse of this my dll is not working properly
And why do you think your dll isn't working - what evidence do you have?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
can u send me...ur personel ID... rajeeshmp@gmail.com
-
Dear Stuart Uuid is same only.. i have a doubt
#ifndef __AppFastLib_LIBRARY_DEFINED__
#define __AppFastLib_LIBRARY_DEFINED__/* library AppFastLib */
/* [helpstring][version][uuid] */EXTERN_C const IID LIBID_AppFastLib;
#endif /* __AppFastLib_LIBRARY_DEFINED__ *//* Additional Prototypes for ALL interfaces */
this is generating at compiling time in ABC_i.h if i m manualy trying to add my code. That would be deleted...
EXTERN_C const CLSID CLSID_ABC;
#ifdef __cplusplus
class DECLSPEC_UUID("97676011-B0FA-40cf-AECC-7BD3FF54BE4E")
ABC;
#endifhow do i add this class instant in ABC_i.h Regards Rajeesh