Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 12th, 2005, 12:17 PM   #1
scicatur
Newbie
 
Join Date: May 2005
Posts: 8
Rep Power: 0 scicatur is on a distinguished road
Problem with using DLL from simple c++ program.

Hi,

I am new to dll programming and I have problem in using a dll library named litgen.dll which ships with litgen.idl . Now I don't have or intend to buy Microsoft Visual C++ or .NET environments. I prefer to use wingw (gcc variation for windows) for one because it's free of charge. Now I have code examples from microsoft to show me just how to use this dll ^properly^ but that's not going to work for me because those code examples are snobbish showoffs of almost every imaginable Microsoft specific programming tricks (like smart pointers, etc.etc.) not to mention that they require me to make litgen.h file using their midl.exe program which is shipped only to buying custormers with Visual C++ or .NET. What I wan't is just to use the functions in the dll the simplest way imaginable.

I guess luckily i got the .idl file with the dll, because it describes just what kinds of interfaces and functions there are inside the dll. But being new to the dll programming I just don't know how to gain access to them and use them. So if you could kindly give me example code how to use e.g. the Message() function described below.. (windows.h naturally available for my project)

Snippet from the .idl:

[object, uuid(6BC62165-B91C-4993-8002-5BC30B2D1196)]
interface ILITCallback : IUnknown
{
    //+-----------------------------------------------------------------------
    //
    //  Function:       Message
    //  Description:    receives a warning, error, or informational message
    //  Parameters:     iType - message type indicator:
    //                       0: fatal error
    //                       1: warning
    //                      -1: informational message
    //                  iMessageCode - see above
    //                  pwszMessage - null-terminated message text
    //  Returns:        S_OK
    //  Notes:
    //
    //------------------------------------------------------------------------
    HRESULT Message([in] int iType, [in] int iMessageCode, 
                    [in, string] const wchar_t* pwszMessage);
};

Last edited by scicatur; May 12th, 2005 at 1:05 PM. Reason: formatting
scicatur is offline   Reply With Quote
Old May 12th, 2005, 1:01 PM   #2
LOI Kratong
Professional Programmer
 
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4 LOI Kratong is on a distinguished road
Just out of interest why do you want to know how to do this in both c and c++? You've posted the same message in c and c++ forums!!

Just curious...
__________________
www.heldtogether.co.uk
LOI Kratong is offline   Reply With Quote
Old May 12th, 2005, 1:15 PM   #3
scicatur
Newbie
 
Join Date: May 2005
Posts: 8
Rep Power: 0 scicatur is on a distinguished road
Why in both c and c++? Because I prefer c language solution to my problem but I don't wan't to exclude C++ solution either. Solutions in both languages are good for me and I believe that when I see solution written in C++ I can deduce it to C. Also C++ forum gets more audience.

And the rest of your message seems to be ambiguous. No my question was not a newbie question. I just signed in the forum and hadn't time to change my status. And no your "solution" is not helpful. You can go search google for the meaning for life for all that matters but this is a programming forum.
scicatur is offline   Reply With Quote
Old May 12th, 2005, 1:23 PM   #4
LOI Kratong
Professional Programmer
 
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4 LOI Kratong is on a distinguished road
Well that's a fair enough reason...

I think you've misinterpreted (is that how you spell that word?) my post. No wonder my 'post' seems ambiguous, it's my sig!

Fairly random sig!!!
__________________
www.heldtogether.co.uk
LOI Kratong is offline   Reply With Quote
Old May 12th, 2005, 1:38 PM   #5
scicatur
Newbie
 
Join Date: May 2005
Posts: 8
Rep Power: 0 scicatur is on a distinguished road
Ok maybe i did misinterpret, misunderstandings happen so no hard feelings then.
scicatur is offline   Reply With Quote
Old May 12th, 2005, 1:46 PM   #6
LOI Kratong
Professional Programmer
 
Join Date: May 2005
Location: Woo - Boot Sector!
Posts: 294
Rep Power: 4 LOI Kratong is on a distinguished road
no none at all
__________________
www.heldtogether.co.uk
LOI Kratong is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:57 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC