Click here to Skip to main content
16,011,949 members
Home / Discussions / COM
   

COM

 
QuestionCan i import the MODI.dll into visual c++ 2005? Pin
$uresh $hanmugam28-Dec-06 1:52
$uresh $hanmugam28-Dec-06 1:52 
QuestionCOM exe registration ? Pin
Sakthiu27-Dec-06 23:35
Sakthiu27-Dec-06 23:35 
AnswerRe: COM exe registration ? Pin
User 21559728-Dec-06 3:29
User 21559728-Dec-06 3:29 
QuestionHow can i call COM DLL in vc++ 2005? Pin
$uresh $hanmugam27-Dec-06 22:51
$uresh $hanmugam27-Dec-06 22:51 
AnswerRe: How can i call COM DLL in vc++ 2005? Pin
Sakthiu27-Dec-06 23:40
Sakthiu27-Dec-06 23:40 
GeneralRe: How can i call COM DLL in vc++ 2005? Pin
$uresh $hanmugam28-Dec-06 1:40
$uresh $hanmugam28-Dec-06 1:40 
AnswerRe: How can i call COM DLL in vc++ 2005? Pin
prasad_som28-Dec-06 1:54
prasad_som28-Dec-06 1:54 
GeneralRe: How can i call COM DLL in vc++ 2005? Pin
$uresh $hanmugam28-Dec-06 23:44
$uresh $hanmugam28-Dec-06 23:44 
Hi Prasad,

I had read ur article.It's really usefull for me...

I followed correctly through ur sending article and successfully loading my dll,
but when i clicked the OK button,
1) MessageBox within "s" message and
2) MessageBox within "Failed" message showned and
3) assertion failed would be throwned.
my source code look like this...



void Ctest2_vcDlg::OnBnClickedOk()

{

// TODO: Add your control notification handler code here

CString s1,s2,s3;

s1=_T("c:\\p1.pdf");

s2=_T("c:\\pppp.jpg");

s3=_T("jpeg");



BSTR b1,b2,b3;

b1=s1.AllocSysString();

b2=s2.AllocSysString();

b3=s3.AllocSysString();



typedef HRESULT (WINAPI *pMakeFile) (BSTR,BSTR,BSTR);

pMakeFile MakeFile;



HMODULE hDll=LoadLibrary(_T("comgs.dll"));

if(hDll)

{

AfxMessageBox(_T("S"));

MakeFile = (pMakeFile)GetProcAddress(hDll,"MakeFile");

if(!MakeFile)

{

AfxMessageBox(_T("Failed"));



}

ATLASSERT(MakeFile);



MakeFile(b1,b2,b3);

FreeLibrary(hDll);

}

else

{

AfxMessageBox(_T("DLL Err"));

ATLASSERT(0);

}



OnOk()
}



And comgs library .tlh file look like this....


// Created by Microsoft (R) C/C++ Compiler Version 14.00.50727.42 (931fd62f).

//

// e:\sureshshanmugam\psudocodes\test2_vc\debug\comgs.tlh

//

// C++ source equivalent of Win32 type library comgs.dll

// compiler-generated file created 12/29/06 at 11:26:07 - DO NOT EDIT!



#pragma once

#pragma pack(push, 8)



#include <comdef.h>



namespace COMGSLib {



//

// Forward references and typedefs

//



struct __declspec(uuid("7a474480-a013-11d3-9c8b-00e098055175"))

/* LIBID */ __COMGSLib;

struct /* coclass */ gscript;

struct __declspec(uuid("7a47448c-a013-11d3-9c8b-00e098055175"))

/* dual interface */ Igscript;



//

// Smart pointer typedef declarations

//



_COM_SMARTPTR_TYPEDEF(Igscript, __uuidof(Igscript));



//

// Type library items

//



struct __declspec(uuid("7a47448d-a013-11d3-9c8b-00e098055175"))

gscript;

// [ default ] interface Igscript



struct __declspec(uuid("7a47448c-a013-11d3-9c8b-00e098055175"))

Igscript : IDispatch

{

//

// Wrapper methods for error-handling

//



HRESULT MakeFile (

_bstr_t inputfile,

_bstr_t outputfile,

_bstr_t devicename );



//

// Raw methods provided by interface

//



virtual HRESULT __stdcall raw_MakeFile (

/*[in]*/ BSTR inputfile,

/*[in]*/ BSTR outputfile,

/*[in]*/ BSTR devicename ) = 0;

};



//

// Wrapper method implementations

//



#include "e:\sureshshanmugam\psudocodes\test2_vc\debug\comgs.tli"



} // namespace COMGSLib



#pragma pack(pop)
AnswerRe: How can i call COM DLL in vc++ 2005? Pin
prasad_som29-Dec-06 0:28
prasad_som29-Dec-06 0:28 
GeneralRe: How can i call COM DLL in vc++ 2005? [modified] Pin
$uresh $hanmugam29-Dec-06 4:22
$uresh $hanmugam29-Dec-06 4:22 
QuestionAmateur Pin
Shouvik Das27-Dec-06 20:33
Shouvik Das27-Dec-06 20:33 
AnswerRe: Amateur Pin
prasad_som28-Dec-06 1:56
prasad_som28-Dec-06 1:56 
GeneralRe: Amateur Pin
Shouvik Das28-Dec-06 2:02
Shouvik Das28-Dec-06 2:02 
GeneralRe: Amateur Pin
prasad_som28-Dec-06 2:16
prasad_som28-Dec-06 2:16 
GeneralRe: Amateur Pin
Shouvik Das28-Dec-06 2:31
Shouvik Das28-Dec-06 2:31 
GeneralRe: Amateur Pin
prasad_som28-Dec-06 2:48
prasad_som28-Dec-06 2:48 
QuestionTLBIMP.exe and COM Pin
mgmail27-Dec-06 8:34
mgmail27-Dec-06 8:34 
AnswerRe: TLBIMP.exe and COM Pin
mgmail27-Dec-06 9:39
mgmail27-Dec-06 9:39 
QuestionHow can i use MODI in Vc++? Pin
$uresh $hanmugam26-Dec-06 19:27
$uresh $hanmugam26-Dec-06 19:27 
QuestionCannot expand "com+ applications" from MMC Snap-In Pin
scorpvg26-Dec-06 2:47
scorpvg26-Dec-06 2:47 
Questionvss automation Pin
mian ghous23-Dec-06 2:39
mian ghous23-Dec-06 2:39 
QuestionIs there any way to replace the dll with out IIS restart Pin
Rajkamal_dfine22-Dec-06 1:36
Rajkamal_dfine22-Dec-06 1:36 
Questioncom surrogated Pin
sudharsong21-Dec-06 19:21
sudharsong21-Dec-06 19:21 
QuestionQuestion about MFC &COM Application ? Pin
Sakthiu20-Dec-06 2:07
Sakthiu20-Dec-06 2:07 
AnswerRe: Question about MFC &COM Application ? Pin
Skond23-Dec-06 2:50
Skond23-Dec-06 2:50 

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.