Click here to Skip to main content
15,912,312 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange CTreeCtrl behavior Pin
Ken Goguen20-Sep-01 9:50
Ken Goguen20-Sep-01 9:50 
GeneralRe: Strange CTreeCtrl behavior Pin
Tomasz Sowinski20-Sep-01 9:29
Tomasz Sowinski20-Sep-01 9:29 
GeneralRe: Strange CTreeCtrl behavior Pin
Ken Goguen20-Sep-01 9:53
Ken Goguen20-Sep-01 9:53 
GeneralRe: Strange CTreeCtrl behavior Pin
Tomasz Sowinski20-Sep-01 9:57
Tomasz Sowinski20-Sep-01 9:57 
GeneralRe: Strange CTreeCtrl behavior Pin
Ken Goguen20-Sep-01 10:12
Ken Goguen20-Sep-01 10:12 
GeneralDLL Question Pin
#realJSOP20-Sep-01 9:03
professional#realJSOP20-Sep-01 9:03 
GeneralRe: DLL Question Pin
Tomasz Sowinski20-Sep-01 9:15
Tomasz Sowinski20-Sep-01 9:15 
GeneralOleAutomation Pin
duggie20-Sep-01 8:43
duggie20-Sep-01 8:43 
I am new to OleAutomation. I am trying to execute an Access macro from VC++. I believe I am missing something. It doesn't work. The code is attached below.

_Application oAccess;
IDoCmd cmd;
LPDISPATCH lpDisp;


/////////////////////////////////////////////////////////////////////////////
// CTemp1App initialization

BOOL CTemp1App::InitInstance()
{
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}

if (!oAccess.CreateDispatch("Access.Application"))
{
AfxMessageBox("Couldn't CreateDispatch on Access");
}

oAccess.OpenCurrentDatabase("S:\\Ses\\User\\VKaruppiah\\Upfitter97.mdb", FALSE);

COleVariant macroName = "GMDIDProcessing";
COleVariant repeatCount = "";
COleVariant repeatExp = "";
cmd.RunMacro(macroName, repeatCount, repeatExp);

cmd.ReleaseDispatch(); // Release the object-IDispatch binding.
oAccess.ReleaseDispatch();
cmd = NULL; // Destroy the object references.
oAccess = NULL;

}

Any help would be greatly appreciated.

Thanks,
Confused | :confused:
GeneralRe: OleAutomation Pin
Michael P Butler20-Sep-01 10:34
Michael P Butler20-Sep-01 10:34 
GeneralRe: OleAutomation Pin
duggie20-Sep-01 10:52
duggie20-Sep-01 10:52 
GeneralRe: OleAutomation Pin
Michael P Butler20-Sep-01 10:55
Michael P Butler20-Sep-01 10:55 
GeneralRe: OleAutomation Pin
Carlos Antollini20-Sep-01 10:53
Carlos Antollini20-Sep-01 10:53 
GeneralRe: OleAutomation Pin
duggie24-Sep-01 10:09
duggie24-Sep-01 10:09 
GeneralRe: OleAutomation Pin
Carlos Antollini25-Sep-01 9:15
Carlos Antollini25-Sep-01 9:15 
GeneralRe: OleAutomation Pin
duggie28-Sep-01 8:09
duggie28-Sep-01 8:09 
GeneralRe: OleAutomation Pin
Carlos Antollini28-Sep-01 8:14
Carlos Antollini28-Sep-01 8:14 
GeneralRadio Btns Pin
john john mackey20-Sep-01 7:08
john john mackey20-Sep-01 7:08 
GeneralRe: Radio Btns Pin
Ravi Bhavnani20-Sep-01 7:55
professionalRavi Bhavnani20-Sep-01 7:55 
GeneralRe: Radio Btns Pin
Ravi Bhavnani20-Sep-01 11:21
professionalRavi Bhavnani20-Sep-01 11:21 
GeneralBeginning whit ActiveX... How-To make an activeX control Pin
Remi Morin20-Sep-01 5:43
Remi Morin20-Sep-01 5:43 
GeneralUnrecognised Database Format Pin
sriram_mr19-Sep-01 23:45
sriram_mr19-Sep-01 23:45 
GeneralRe: Unrecognised Database Format Pin
Oscar Vazquez21-Sep-01 11:54
Oscar Vazquez21-Sep-01 11:54 
GeneralExplorer Like Resizing Pin
Ray Kinsella19-Sep-01 23:13
Ray Kinsella19-Sep-01 23:13 
GeneralRe: Explorer Like Resizing Pin
Christian Graus19-Sep-01 23:36
protectorChristian Graus19-Sep-01 23:36 
GeneralRe: Explorer Like Resizing Pin
Ray Kinsella19-Sep-01 23:59
Ray Kinsella19-Sep-01 23:59 

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.