Author |
Topic |
|
cyberhouse
New Member
5 Posts |
Posted - Apr 25 2007 : 03:13:09 AM
|
when i use visual assist X to import an ATL tlb file, the intellisense cannot show the wrapper class created by visual studio. for example:
#import "testatl2005a.tlb" rename_namespace("TDM") named_guids
void test() { TDM::ITest1ObjPtr pTmp; //TDM:: --cannot display ITest1ObjPtr pTmp.CreateInstance(TDM::CLSID_Test1Obj); //TDM:: --not show anything pTmp->showHello(); //pTmp-> --cannot display showHello
}
this problem has existed for a long time. even in the latest version.
but the visual assist 4.1 for VC 6 show it correctly. why?
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Apr 25 2007 : 06:53:15 AM
|
Do you have a simple test project that shows this effect that you could send me? I am not sure how to create the ATL TLB file and setup this test. |
zen is the art of being at one with the two'ness |
|
|
cyberhouse
New Member
5 Posts |
Posted - Apr 25 2007 : 09:55:39 AM
|
suppose we create two projects, the first is an ATL project, the second is a MFC dialog application. we use visual C++ 6.0 to do it.
$1.create an ATL project 1.using visual C++ wizard, select ATL COM AppWizard, fill the project name with MyAtlTest 2.using default application type(dll) 3.add an ATL Object, select simple object, fill the coclass name with TestObj, the interface with ITestObj 4.build the project, then add a method 'showHello' to ITestObj interface 5.build the project. we will find the MyAtlTest.tlb in the project directory. this is a type library file. $2.create a MFC dialog application 1.using visual c++ wizard, select MFC AppWizard, fill the project name with testMFC, select dialog based application type. 2.copy MyAtlTest.tlb from MyAtltest to testMFC project's directory 3.add a line AfxOleInit(); in the CTestMFCApp::InitInstance() function. 4.add a button in the dialog resource, double click the button
5.open testMfCdlg.cpp, add a line below #include "testMFCDlg.h" : #import "MyAtlTest.tlb" rename_namespace("TDM") named_guids we can also use MyAtlTest.dll instead of MyAtlTest.tlb 6.in OnButton1() function, we can write the codes: TDM::ITestObjPtr pTmp;
pTmp.CreateInstance(TDM::CLSID_TestObj); pTmp->showHello(); if we use visual assist 4.1, the intellisense works well, but visual assist X show nothing.
|
Edited by - cyberhouse on Apr 25 2007 09:58:22 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Apr 25 2007 : 4:28:40 PM
|
Fairly clear instructions, but this is not going quickly, I am working out what I am trying to do as I go along. So many things to know
Does this seem to be a similar problem to this thread?
http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=6004
If so then I should have that test project on hand, but I was unable to reproduce the reported bug there. |
zen is the art of being at one with the two'ness |
|
|
cyberhouse
New Member
5 Posts |
Posted - Apr 26 2007 : 08:24:32 AM
|
similar with that topic, but i found visual assist x neither supports VC 6.0, nor supports vs.net 2005. The #import directive is used to incorporate information from a type library, it generates two files(*.tli, *.tlh) during compile the source files. i guess the visual assist x may not be parse these files. the old version VA 4.1 maybe parse these files.
|
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Apr 26 2007 : 10:18:34 AM
|
Can you download the following test project please?
http://forum.wholetomato.com/colin/forumimages/thread_6157_com_hello.zip
This is a VS2005 format project, the one I used to test thread 6004. This way we will both be looking at the same thing. If you can easily reproduce the problem then I can follow the same steps as you, and see what happens on my test machine. |
zen is the art of being at one with the two'ness |
|
|
cyberhouse
New Member
5 Posts |
Posted - Apr 26 2007 : 9:48:18 PM
|
i tested your project, using VA X 1549, it works well. but if i change the code #import "..\\debug\\hello.dll" no_namespace to #import "..\\debug\\hello.dll" rename_namespace("TDM") named_guids
then type TDM:: it couldn't work.
|
Edited by - cyberhouse on Apr 26 2007 11:11:32 PM |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Apr 27 2007 : 09:34:23 AM
|
I am seeing the same effect here. Thank you for the clear description.
case=6261 |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|