Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

A DLL Problem, (for gurus)


  • Please log in to reply

#1
scicatur

scicatur

    Member

  • Member
  • PipPip
  • 16 posts
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. Also I am doing this with C *not C++* 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); 
};

  • 0

Advertisements


#2
Bobbi Flekman

Bobbi Flekman

    The Computer Whisperer

  • Expert
  • 3,761 posts
  • MVP
I am not sure what you are asking, but you can create COM instances by using the function CoCreateInstance(). You would have to many more things to get it to work properly like initializing the Interface pointer, etc.

This is a link to a book that can teach you COM programming in plain C...

http://www.amazon.co...=books&n=507846
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP