Click here to Skip to main content
16,005,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMemory allocation failure Pin
AJarrett24-Mar-04 8:57
AJarrett24-Mar-04 8:57 
GeneralRe: Memory allocation failure Pin
l a u r e n24-Mar-04 9:02
l a u r e n24-Mar-04 9:02 
GeneralRe: Memory allocation failure Pin
AJarrett24-Mar-04 9:09
AJarrett24-Mar-04 9:09 
GeneralRe: Memory allocation failure Pin
Neville Franks24-Mar-04 9:16
Neville Franks24-Mar-04 9:16 
GeneralRe: Memory allocation failure Pin
AJarrett24-Mar-04 9:25
AJarrett24-Mar-04 9:25 
GeneralRe: Memory allocation failure Pin
John R. Shaw24-Mar-04 9:59
John R. Shaw24-Mar-04 9:59 
GeneralRe: Memory allocation failure Pin
axid3j1al24-Mar-04 11:37
axid3j1al24-Mar-04 11:37 
GeneralAccessing a COM object in a DLL Pin
aafflyer24-Mar-04 8:52
aafflyer24-Mar-04 8:52 
You will have to forgive me for getting some of the terminolgy wrong or asking what may seem like a newbie question.

I've got years and years of programming experience, mostly C and mostly embedded, so I don't write a lot from scratch for the PC environment. But give me any existing code in almost any language, and I fix items or add new features.

So, I just got into the Home Theater PC scene, bought an LCD display for the case, and now am a beta tester for the control software that drives the LCD. The company just recenly released to the beta testers C++ code that implements a plug in via a DLL to their software. Fine, no problem.

Using Visual Studio .Net 2003 I have successfully made three additional plug is to "expose" different information to the LCD control software, i.e. an example would be going to a Web Server and getting weather information to display.

Well, now I want to display information from S.M.A.R.T. hard drives. I found a publicly available .DLL that uses the COM architecture. Took a little bit of time figuring out how to invoke this in .Net, but I got it working. In fact, it's very cool how you just add a reference and it builds an "Interop::xxx" wrapper for you. Then you can just create an instance of the class, and off you go.

So having implemented and tested my logic for getting the data I wanted from the COM DLL, I then went about and created a new project for the DLL planning to cut and paste my logic with appropriate adjustments into my MFC DLL. Wrong!

I've done tons of searches and tried all different ways, but I'm not even close to getting this working. So my question is can someone point me in the right direction or post some sample code? It seems to me that I need a .h file or something that describes the interfaces. And even if I get a pointer to the interface, how do I get the structures that the interfaces are passing back? It seemed like it was going to be such a piece of cake the way the .Net worked.

Any and all help would be appreciated. I can also post or email the zipped project and DLL if it would be helpful.

Charlie


GeneralRe: Accessing a COM object in a DLL Pin
aafflyer26-Mar-04 7:58
aafflyer26-Mar-04 7:58 
GeneralMemory leak msg... Pin
0v3rloader24-Mar-04 8:39
0v3rloader24-Mar-04 8:39 
GeneralRe: Memory leak msg... Pin
David Crow24-Mar-04 9:12
David Crow24-Mar-04 9:12 
GeneralRe: Memory leak msg... Pin
0v3rloader24-Mar-04 9:22
0v3rloader24-Mar-04 9:22 
GeneralLowLevelKeyboardProc possible return values Pin
0v3rloader24-Mar-04 8:30
0v3rloader24-Mar-04 8:30 
GeneralSQLConnect connection string Pin
BlackDice24-Mar-04 7:49
BlackDice24-Mar-04 7:49 
GeneralRe: SQLConnect connection string Pin
David Crow24-Mar-04 7:53
David Crow24-Mar-04 7:53 
GeneralRe: SQLConnect connection string Pin
BlackDice24-Mar-04 8:01
BlackDice24-Mar-04 8:01 
GeneralRe: SQLConnect connection string Pin
David Crow24-Mar-04 8:10
David Crow24-Mar-04 8:10 
GeneralRe: SQLConnect connection string Pin
BlackDice24-Mar-04 8:18
BlackDice24-Mar-04 8:18 
GeneralRe: SQLConnect connection string Pin
David Crow24-Mar-04 9:11
David Crow24-Mar-04 9:11 
QuestionMouse direction settings? Pin
DaFrawg24-Mar-04 7:31
DaFrawg24-Mar-04 7:31 
GeneralLink Error Pin
satcat24-Mar-04 6:27
satcat24-Mar-04 6:27 
GeneralRe: Link Error Pin
Navin24-Mar-04 6:35
Navin24-Mar-04 6:35 
GeneralRe: Link Error Pin
satcat24-Mar-04 7:21
satcat24-Mar-04 7:21 
GeneralRe: Link Error Pin
David Crow24-Mar-04 7:11
David Crow24-Mar-04 7:11 
GeneralRe: Link Error Pin
satcat24-Mar-04 7:46
satcat24-Mar-04 7:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.