Click here to Skip to main content
15,890,512 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionATL error [modified] Pin
shakumar_212-Jul-10 21:32
shakumar_212-Jul-10 21:32 
AnswerRe: ATL error Pin
Stephen Hewitt4-Jul-10 14:48
Stephen Hewitt4-Jul-10 14:48 
QuestionCapturing IE Events Pin
Adeel Mirza1-Jul-10 0:08
Adeel Mirza1-Jul-10 0:08 
QuestionHow to get Drive name of current OS installed Pin
am 200928-Jun-10 18:46
am 200928-Jun-10 18:46 
AnswerRe: How to get Drive name of current OS installed Pin
gpsushil28-Jun-10 20:26
gpsushil28-Jun-10 20:26 
QuestionDisplay controls in editor-created tab control [modified] Pin
Splatt4223-Jun-10 7:59
Splatt4223-Jun-10 7:59 
AnswerRe: Display controls in editor-created tab control Pin
Jonathan Davies10-Jul-10 3:04
Jonathan Davies10-Jul-10 3:04 
QuestionUsing CoCreateInstance crashes the program?? [modified] Pin
Kiran Satish22-Jun-10 11:40
Kiran Satish22-Jun-10 11:40 
Ok, here is the story. Till now I have a dialog based application which uses a COM object to communicate with a third party hardware. For this in vc++6 I used to do as follows

-Add a new ATL object to the project
-Include/import the necessary files
#include "thirdparty.h"
#import "_thirdparty.tlb" no_namespace
using namespace std;
-Define a variable
CComPtr<IHostDrv> pIHostDrv;
-in cpp file
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(__uuidof(CHostDrv), NULL, CLSCTX_INPROC_SERVER, __uuidof(IHostDrv), (LPVOID *) &pIHostDrv);
if (SUCCEEDED(hr) && pIHostDrv)
{
//do blah blah..
}

everything works great.
Now I am moving my application to VC++2008 and I got everyting cleaned up (all warning messages and that sort of stuff) and the program complied fine. But when I run it, the CoCreateInstance returns with an error 0x80020008 (which is bad variable type). --- this error is still there even after replacing the tlb/lib files with ones generated using VC++2008.

//the following crash error has been resolved by recreating tlb and lib files on VC++2008
So I thought maybe ATL interfacing is different in VS2008, so I started out with a simple MFC dialog based application and tried to create COM object as follows (following MSDN)
-Create the MFC project
-Add new class and then ATL Support to MFC code, then I do the same as above and now the program crashes on CoCreateInstance method (Unhandled exception at 0x003f1978 in VS2008test.exe: 0xC0000005: Access violation.)
But when I run the sample project (which is also a dialog based app) that uses this library provided by third party company (which was created in VS2005) in VS2008, it runs fine and I checked the commands and they were exactly the same I am using in mine. I am a bit lost now D'Oh! | :doh: , anyone have any ideas why I am having this problem (bad variable type)??

thanks,
PKNT
modified on Tuesday, June 22, 2010 7:30 PM

QuestionRetriving the active contents of a Webpage Pin
Adeel Mirza21-Jun-10 2:07
Adeel Mirza21-Jun-10 2:07 
AnswerRe: Retriving the active contents of a Webpage Pin
Eddy Vluggen22-Jun-10 0:42
professionalEddy Vluggen22-Jun-10 0:42 
QuestionInternet Explorer ExplorerBar Pin
Adeel Mirza15-Jun-10 20:52
Adeel Mirza15-Jun-10 20:52 
AnswerRe: Internet Explorer ExplorerBar Pin
Richard MacCutchan15-Jun-10 21:39
mveRichard MacCutchan15-Jun-10 21:39 
GeneralRe: Internet Explorer ExplorerBar Pin
Adeel Mirza15-Jun-10 23:58
Adeel Mirza15-Jun-10 23:58 
GeneralRe: Internet Explorer ExplorerBar Pin
Richard MacCutchan16-Jun-10 1:52
mveRichard MacCutchan16-Jun-10 1:52 
GeneralRe: Internet Explorer ExplorerBar Pin
Adeel Mirza16-Jun-10 1:56
Adeel Mirza16-Jun-10 1:56 
GeneralRe: Internet Explorer ExplorerBar Pin
Richard MacCutchan16-Jun-10 3:01
mveRichard MacCutchan16-Jun-10 3:01 
GeneralRe: Internet Explorer ExplorerBar Pin
Adeel Mirza16-Jun-10 3:13
Adeel Mirza16-Jun-10 3:13 
GeneralRe: Internet Explorer ExplorerBar Pin
Richard MacCutchan16-Jun-10 5:01
mveRichard MacCutchan16-Jun-10 5:01 
GeneralRe: Internet Explorer ExplorerBar Pin
Adeel Mirza16-Jun-10 19:10
Adeel Mirza16-Jun-10 19:10 
GeneralRe: Internet Explorer ExplorerBar Pin
Richard MacCutchan16-Jun-10 21:16
mveRichard MacCutchan16-Jun-10 21:16 
GeneralRe: Internet Explorer ExplorerBar Pin
Adeel Mirza16-Jun-10 21:24
Adeel Mirza16-Jun-10 21:24 
GeneralRe: Internet Explorer ExplorerBar Pin
Richard MacCutchan16-Jun-10 22:59
mveRichard MacCutchan16-Jun-10 22:59 
AnswerRe: Internet Explorer ExplorerBar Pin
Eddy Vluggen16-Jun-10 23:44
professionalEddy Vluggen16-Jun-10 23:44 
AnswerRe: Internet Explorer ExplorerBar Pin
Stephen Hewitt20-Jun-10 14:28
Stephen Hewitt20-Jun-10 14:28 
QuestionHOW TO ACCESS CListBox in ATL Pin
D1koi11-Jun-10 2:48
D1koi11-Jun-10 2:48 

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.