Click here to Skip to main content
15,916,189 members
Home / Discussions / COM
   

COM

 
GeneralPassing a IDispatch reference between two COM+ Components Pin
Rohit28-Mar-02 3:57
Rohit28-Mar-02 3:57 
GeneralRe: Passing a IDispatch reference between two COM+ Components Pin
soptest29-Mar-02 14:20
soptest29-Mar-02 14:20 
GeneralRe: Passing a IDispatch reference between two COM+ Components Pin
Rohit29-Mar-02 17:24
Rohit29-Mar-02 17:24 
GeneralRe: Passing a IDispatch reference between two COM+ Components Pin
soptest30-Mar-02 9:13
soptest30-Mar-02 9:13 
GeneralRe: Passing a IDispatch reference between two COM+ Components Pin
Rohit31-Mar-02 0:12
Rohit31-Mar-02 0:12 
GeneralHandling COM Events from script Pin
Gerald Schwab27-Mar-02 18:55
Gerald Schwab27-Mar-02 18:55 
GeneralRe: Handling COM Events from script Pin
28-Mar-02 6:19
suss28-Mar-02 6:19 
GeneralA File Dialog in COM Pin
AndyC27-Mar-02 7:50
AndyC27-Mar-02 7:50 
I have an ATL COM dll with MFC support and am trying get an File dialog to display, I can understand why a CFileDilog would not work, I guess. So I tried to use the GetOpenFileName() function. But whilst this compiles it doesn't display the dialog, it olny return the error code 2, which stands for file can't be found. The code segment I have used is below, if anybody has any ideas I would really like to hear them, Please....

long lErrMsg = 0;
OPENFILENAME ofn;
TCHAR sfile[MAX_PATH];

ZeroMemory(&ofn, sizeof(ofn));

ZeroMemory(sfile, sizeof(TCHAR)*MAX_PATH);

#ifndef NULL_TERMINATE
// Not NULL terminated.
{
int i;
for (i = 0; i < MAX_PATH; i++)
sfile[i] = ' ';
}
#else
// NULL terminated.
sfile[0] = '\0';
#endif


ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL;
ofn.lpstrFile = sfile;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrFilter = NULL;
ofn.nFilterIndex = 1;
ofn.lpstrTitle = TEXT("Please Select a File");
ofn.lpstrInitialDir = NULL;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
ofn.lCustData = 0;
ofn.lpfnHook = 0;
ofn.lpTemplateName = 0;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;

// Call GetOpenFileName().
if (GetOpenFileName(&ofn))
{
MessageBox(TEXT("GetOpenFileName() Successful"), TEXT("OpenDialog"), MB_OK);
}
else
{
TCHAR sErrMsg[256];
lErrMsg = CommDlgExtendedError();
wsprintf(sErrMsg,TEXT("Error %d returned from GetOpenFileName()"), lErrMsg);
MessageBox(sErrMsg, TEXT("OpenDialog"), MB_OK);
}

Cheers
GeneralRe: A File Dialog in COM Pin
soptest27-Mar-02 9:45
soptest27-Mar-02 9:45 
GeneralRe: A File Dialog in COM Pin
AndyC27-Mar-02 21:37
AndyC27-Mar-02 21:37 
Generalplease help me !! I get E_NOINTERFACE error... using CLSCTX_LOCAL_SERVER Pin
johnstapleton27-Mar-02 5:59
johnstapleton27-Mar-02 5:59 
GeneralServer name problem Pin
27-Mar-02 4:11
suss27-Mar-02 4:11 
GeneralUrgent!! Creating own stream in a Word Document Pin
26-Mar-02 23:02
suss26-Mar-02 23:02 
GeneralPointer to an ActiveX in VB Pin
Jerome Conus26-Mar-02 19:46
Jerome Conus26-Mar-02 19:46 
GeneralCOM Object Pin
Nick Parker26-Mar-02 18:16
protectorNick Parker26-Mar-02 18:16 
GeneralRe: COM Object Pin
Paul M Watt26-Mar-02 18:53
mentorPaul M Watt26-Mar-02 18:53 
GeneralRe: COM Object Pin
Michael Dunn26-Mar-02 19:31
sitebuilderMichael Dunn26-Mar-02 19:31 
GeneralReturning Safearray from remote DCOM Pin
David Spain25-Mar-02 12:34
David Spain25-Mar-02 12:34 
GeneralRe: Returning Safearray from remote DCOM Pin
Sayan Mukherjee26-Mar-02 2:36
Sayan Mukherjee26-Mar-02 2:36 
GeneralRe: Returning Safearray from remote DCOM Pin
David Spain26-Mar-02 3:56
David Spain26-Mar-02 3:56 
GeneralRe: Returning Safearray from remote DCOM Pin
David Spain27-Mar-02 2:55
David Spain27-Mar-02 2:55 
GeneralBuilding interface to IActiveScriptSite and IActiveScriptSiteWindow with MFC and ATL 7.0 Pin
25-Mar-02 7:50
suss25-Mar-02 7:50 
GeneralProblems with suspend/resume comm thread. Pin
dejan.n25-Mar-02 4:05
dejan.n25-Mar-02 4:05 
GeneralATL CLSCTX_LOCAL_SERVER get E_NOINTERFACE error... Pin
johnstapleton25-Mar-02 2:46
johnstapleton25-Mar-02 2:46 
GeneralRe: ATL CLSCTX_LOCAL_SERVER get E_NOINTERFACE error... Pin
jfugate18-Jul-02 5:03
jfugate18-Jul-02 5:03 

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.