Creating Plugin in C++

oraclelover

Member²
I know C++, not as well as PL/SQL and other languages I use daily. I used the example included in the plugindoc/vc++. What I'm trying to do is create a new export format. This new format will be pipe delimmeted. Here is my new code that gets me to the point where I'm haveing problems.

//This will put the text in the popup window for the user to select
char* RegisterExport()
{
return "Pipe";
}

bool ExportInit()
{
bool SaveFile;

SaveFile = IDE_SaveFile();//Opens a file dialog so the user can save the output to file in the desired location



return SaveFile;
}

The problem is IDE_SaveFile saves the current SQL statement to file. I only want the user to choose a locaiton and file name and then expor the data to file. So I tried to create a dialog box instance like the code below and this is where my error starts and I can't figure out how to get around it.

bool ExportInit()
{
bool SaveFile;
CFileDialog fileDlg( TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY, "All Files (*.*)|*.*||", this);
return True;
}

Compiling...
StdAfx.cpp
Compiling...
DemoWin32.cpp
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(68) : error C2065: 'CFileDialog' : undeclared identifier
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(68) : error C2146: syntax error : missing ';' before identifier 'fileDlg'
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(68) : error C2065: 'fileDlg' : undeclared identifier
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(68) : error C2065: 'OFN_ALLOWMULTISELECT' : undeclared identifier
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(68) : error C2065: 'OFN_HIDEREADONLY' : undeclared identifier
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(68) : error C2673: 'ExportInit' : global functions do not have 'this' pointers
PlSql_functions.cpp
Generating Code...
Error executing cl.exe.

DemoWin32.dll - 6 error(s), 0 warning(s)

I I then try to include the header
#include I get this message.

--------------------Configuration: DemoWin32 - Win32 Debug--------------------
Compiling...
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include
Error executing cl.exe.

DemoWin32.dll - 1 error(s), 0 warning(s)

Any ideas sorry if this is simple but I don't use c++ much.
 
Ok I moved the #include to be the first include and this error goes away.

Compiling...
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include
Error executing cl.exe.

But I get
Compiling...
StdAfx.cpp
Compiling...
DemoWin32.cpp
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(70) : error C2065: 'CFileDialog' : undeclared identifier
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(70) : error C2146: syntax error : missing ';' before identifier 'fileDlg'
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(70) : error C2065: 'fileDlg' : undeclared identifier
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(70) : error C2065: 'OFN_ALLOWMULTISELECT' : undeclared identifier
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(70) : error C2065: 'OFN_HIDEREADONLY' : undeclared identifier
C:\Program Files\PLSQL Developer\PlugInDoc\VC++\DemoWin32\DemoWin32.cpp(70) : error C2673: 'ExportInit' : global functions do not have 'this' pointers
PlSql_functions.cpp
Generating Code...
Error executing cl.exe.

DemoWin32.dll - 6 error(s), 0 warning(s)
 
Back
Top