OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 29-05-2005, 23:14
mnj
Guest
 
Posts: n/a
Default C++ import errors

I used the code you posted for C++ dll using #import, however, I continue to get the following error:

IDrawIDrawApplicationPtr' : undeclared identifier

I have tried serveral things, but am unable to access these classes.

What am I missing. Thanks.
Reply With Quote
  #2  
Old 29-05-2005, 23:23
Alex's Avatar
Alex Alex is online now
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Care to show your actual code that imports the type library?
Reply With Quote
  #3  
Old 29-05-2005, 23:35
mnj
Guest
 
Posts: n/a
Default

Sorry...
I created a DLL project in VC++ and add the #import line to the top of the CPP file:

#import "CorelDrw100.tlb" no_namespace named_guids

I copied the tlb file into the application DLL project folder (where the cpp file is located)

And I added the following code (just for trial purposes) into the exported function built by the C++ DLL wizard:

try
{
IDrawApplicationPtr app(CLSID_Application);
}
catch(_com_error &e)
{
MessageBox(e.ErrorMessage(), "Error", MB_OK | MB_ICONSTOP);
}

It doesn't recognize the IDrawApplicationPtr. I tried addint the "::" but it says that it isn't part of the global namespace.

Hope this is clear.
Reply With Quote
  #4  
Old 29-05-2005, 23:42
mnj
Guest
 
Posts: n/a
Default additional information

By the way,

The code compiles fine if I put it in an .exe project, just not in a DLL. However, when i try to run the exe, it errors out on the first line:

IDrawApplicationPtr app(CLSID_Application);

And the try catch doesn't compile. I have to comment that out to get to be able to compile and run the sample.
Reply With Quote
  #5  
Old 30-05-2005, 06:53
Alex's Avatar
Alex Alex is online now
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Which version of VC++ are you using?
Reply With Quote
  #6  
Old 30-05-2005, 22:42
mnj
Guest
 
Posts: n/a
Default re: VC++ version

I am using vc++ 6 Enterprise Edition
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
is it possible import data from datagrid columns? olympiatr CorelDRAW/Corel DESIGNER VBA 0 12-01-2005 16:20
Import - Value out of Range ddonnahoe CorelDRAW/Corel DESIGNER VBA 0 13-04-2004 13:10
Import image into bounding box Craig Tucker CorelDRAW/Corel DESIGNER VBA 2 07-10-2003 20:06
How to kill (do not show) Import Postscript filter, rrrrrr modzho CorelDRAW/Corel DESIGNER VBA 1 18-09-2003 10:56
Font Substitution Upon Import RobC CorelDRAW/Corel DESIGNER VBA 4 10-03-2003 23:06


All times are GMT -5. The time now is 23:30.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com