Extention DLL and .DEF Exports

Hi

I have an MFC Extention DLL (VC6 SP5)  from which I exports the classes and
functions like this

#define DLL_EXPORT __declspec(dllexport)
DLL_EXPORT void MyFunction(void);

class DLL_EXPORT MyClasss : public somemfcclasss
{

};

now it works fine.

The problem is when exporting the symbols with the def file. I use depends
and copy the symbols function names from there and in def file it is like
this

?Myfunction@xxxxxx         @ 1 NONAME
?MYCLASS@xxx             @ 2 NONAME

with the functions it works fine. But with the classes it does not work. I
get LNK 2001 error.

I want todo this way becuase it keeps function names out and  do not want
others to know the function names dll is exporting.

Can someone please guide me.

Regards

Shrishail Rana


-1
srana (79)
12/23/2003 8:03:04 AM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
746 Views

Similar Articles

[PageSpeed] 33

"Shrishail Rana" <srana@hotpop.com> wrote in message
news:OKEAasSyDHA.1616@TK2MSFTNGP11.phx.gbl...
> Hi
>
> I have an MFC Extention DLL (VC6 SP5)  from which I exports the classes
and
> functions like this
>
> #define DLL_EXPORT __declspec(dllexport)
> DLL_EXPORT void MyFunction(void);
>
> class DLL_EXPORT MyClasss : public somemfcclasss
> {
>
> };
>
> now it works fine.
>
> The problem is when exporting the symbols with the def file. I use depends
> and copy the symbols function names from there and in def file it is like
> this
>
> ?Myfunction@xxxxxx         @ 1 NONAME
> ?MYCLASS@xxx             @ 2 NONAME
>
> with the functions it works fine. But with the classes it does not work. I
> get LNK 2001 error.
>
> I want todo this way becuase it keeps function names out and  do not want
> others to know the function names dll is exporting.
>
> Can someone please guide me.

Does anything in this document resolve the issue?...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_export_and_import_using_afx_ext_class.asp
-- 
Jeff Partch [VC++ MVP]


1
jeffp (1711)
12/23/2003 11:20:08 AM
Hi Jeff,

No. Actually my extention DLL is working fine. But how can I export
functions using DEF file with ordinal values rather than name.

Regards

Shrishail Rana


1
srana (79)
12/23/2003 2:25:26 PM
"Shrishail Rana" <srana@hotpop.com> wrote in message
news:uOOWECWyDHA.1500@TK2MSFTNGP12.phx.gbl...
> Hi Jeff,
>
> No. Actually my extention DLL is working fine. But how can I export
> functions using DEF file with ordinal values rather than name.

Well, which members are going missing? All of them? Some of them? Members of
your class or members of the MFC base class? Data members? Functions?
Statics? All of the above? Can you provide a simple repro class and def file
that I can look at?
-- 
Jeff Partch [VC++ MVP]


0
jeffp (1711)
12/23/2003 2:36:16 PM
Hi Shrishail 

Thanks for you posting in the group!

You can try the following steps to export C++ class by using DEF file with 
ordinal values:
1. Use the Wizard(New Class...) to add a Class(e.g. CMath) to the project:
    class CMath  	//in the file Math.h
    {
     public:
             int Add(int a, int b);
             CMath();
             virtual ~CMath();
     };

    implement the CMath::add() in the file Math.cpp:�
    CMath::Add(int a,int b){ return a+b; }
	
2. Select the Project\Settings...�\Link tab, check the Generate mapfile, 
then Rebuild All the project. 

3. Open the project's .map file(which in the Debug or Release directory), 
find out the Math.obj entries:

??0CMath@@QAE@XZ                 100012f0 f   Math.obj
??_ECMath@@UAEPAXI@Z       10001330 f  Math.obj
??_GCMath@@UAEPAXI@Z       10001330 f  Math.obj
??1CMath@@UAE@XZ                  100013a0 f   Math.obj
?Add@CMath@@QAEHHH@Z   100013e0 f   Math.obj

4. Copy the symbols of the line1,4,5 to your project's .Def file as follows:
�
	??0CMath@@QAE@XZ		@1
	??1CMath@@UAE@XZ		@2
	?Add@CMath@@QAEHHH@Z	@3  

5. Save all, then Rebuild All the project.


Hope it helps!

Best Regards!
 
Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

0
v-garych (605)
12/26/2003 3:27:04 AM
Hi

I was able to create but it gives error

..\codedll.def : warning LNK4102: export of deleting destructor "public:
virtual void * __thiscall CBase64::`scalar deleting destructor'(unsigned
int)"; image may not run correctly

Error LNK2001: unresolved external symbol "public: virtual void * __thiscall
CBase64::`vector deleting destructor'(unsigned int)"
(??_ECBase64@@UAEPAXI@Z)

Shall I export it or not. But when I use __declspec(dllexport) this symbol
is exported.

With kindest regards

Shrishail Rana


0
srana (79)
12/26/2003 7:11:39 AM
Hi Shrishail,

Thanks for your quickly reply!

I think you don't need to export the ??_ECBase64@@UAEPAXI@Z symbol.


Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

0
v-garych (605)
12/26/2003 9:57:45 AM
Reply:

Similar Artilces:

Exporting database documenter info to table
Used to be you could export table and field information via the database documenter to a table. Does anyone out there have any pointers on how do to that in 2007? It appears to try but fails - in my case anyhow - with messages like "doc_rptObject does not exist... and/or doc_rptObject can not be opened". Thanks. "Browser" <Browser@discussions.microsoft.com> wrote in message news:5F5602D4-FB58-437F-BDC0-E1E90D851C62@microsoft.com... > Used to be you could export table and field information via the database > documenter to a table. Does anyone ou...

Excel 2007
Hello all, I have a little problem to resolve. I have worked on an Excel 2007 sheet and am trying to export it to a tab delimited text file (Save As...) but when the file is exported, and when I open it with a text editor such as Notepad then I view a lot of doublequotes added to some values... Do you have a clue about that ? I'd like to get a text file that has nothing added to it when exporting it... Thanks Excel does what it thinks is right. You could use a macro and write code and have complete control over what you write. Here are three sites that you could steal some code from:...

BCP Export of huge amount of data problem
Hello, we have a problem with exporting of huge amount of data (about 100mil. records) from DB to .csv file. We are running following command: bcp "SELECT * from MY_VIEW UNION SELECT * FROM MY_VIEW_HEADER ORDER BY ID DESC" queryout MyData.csv -c -t ; -o MyDataExport.log -a 8192 -S DbServer\MSSQL -T And after some time following error message is displayed: [Microsoft][SQL Native Client][SQL Server]The transaction log for database 'tempdb' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases. Could ...

Win32 DLL def file question
Hi How can we export Win32 dll functions for dynamically LoadLibrary and GetProceeAddress ? I see VS MFC DLL project has a def file but Win32 DLL does not have one, should we add a def file to VS Win32 DLL project , how can I do that ? Thank you . This will be helpful: http://msdn.microsoft.com/en-us/library/d91k01sh(VS.80).aspx -- Ajay "Kid" <Kid@discussions.microsoft.com> wrote in message news:DBBF8564-3F78-4808-B826-A0186AB29CCC@microsoft.com... > Hi > > How can we export Win32 dll functions for dynamically LoadLibrary and > GetProceeAddress ? > &...

CRM 3.0 export to EXCEL error
Hi, On the clients with Vista and office 2007, when we tried to export to EXCEl, got the following error: Connect failed: SQLState 2800 SQL Server error 18452 Login failed for user null. Reason: Not associated with a trusted SQl server connection. With this user, it works well under Xp and office 2003. Any suggestions? Thank you very much! Cindy, Have you installed latest updates for CRM 3.0? If not pls. Here is the latest. http://www.microsoft.com/downloads/details.aspx?FamilyId=D5B1FBBE-DFC2-4A33-B5FD-CAE99E8E9DAB&displaylang=en Venkat. http://venkatbendalam.blogspot.com/ "Ci...

Cannot find analys32.dll
I am running one of the training programs for XML on the MS web. When down loading one of the training files I get the follow error: "Cannot find analys32.xll. Run setup to install ToolPak." The url of the training is http://office.microsoft.com/training/training.aspx?AssetID=RP011304671033&CTT=6&Origin=RP011304921033 ToolPak is installed and analys32.xll resides on my computer. I have uninstalled and reinstalled TookPak, ran Repair from setup on the CD and uninstalled and reinstalled Excel all to no avail. I need to complete the XML training ASAP so that I can...

MFC Extension DLL #3
Hi, I have a dll, which i want to display a dialog. so i go: DlgClass dlg; dlg.DoModal(); However it always crashes on the DoModal() line. DlgClass hWnd = 0x0000000 And it crashes at HINSTANCE hInst = AfxGetResourceHandle(); with the DoModal() call. Any ideas? On Sep 24, 11:16 am, hamishd <Hamish.D...@gmail.com> wrote: > Hi, I have a dll, which i want to display a dialog. > > so i go: > DlgClass dlg; > dlg.DoModal(); > > However it always crashes on the DoModal() line. > DlgClass hWnd = 0x0000000 > And it crashes at HINSTANCE hInst = AfxGetResourceH...

Exporting Shared Tasks to Excel
Hi, I am trying to export tasks in a shared folder to Excel, but when I go to Import and Export to select the folder I want, I don't see the Public Folders as I would in my Folder List. Is it possible to export shared folders? Thanks. You can export your public folder to a PST file - then open the PST file and export to Excel. To the best of my knowledge, you cannot (for some completely unfathomable reason) export a public folder to Excel directly. SQL wrote: > Hi, > > I am trying to export tasks in a shared folder to Excel, but when I > go to Import and Export to select...

Cell export to Text File?
Is it possible to export information in cells to a text file? Where each cell would be a line in the file? Would it be possible to make a button do this if it is at all possible? Try saving as filetype CSV. Rgds, ScottO "Steve" <Steve@discussions.microsoft.com> wrote in message news:522EC33D-DD6E-4EB0-A88D-A5905A41A5D6@microsoft.com... | Is it possible to export information in cells to a text file? | Where each cell would be a line in the file? | | Would it be possible to make a button do this if it is at all possible? Yes that is the file type I can use, and I know I can...

VC6.0 call DLL that built by Visual 2005
Hi, There are three files, test.h, test.lib, test.dll and these files are built by Visual Studio 2005. I use these file in VC 6.0, but it show following error: error LNK2001: unresolved external symbol "long __stdcall Display(unsigned short,unsigned short const *,unsigned short const *,unsigned short,unsigned long (__stdcall*)(struct ABCDATA *))" (?DriveRestore@@YGJGPBG0GP6GKPAU_ABCDATA @@@Z@Z) Can I use these files in VC6? Thanks. Regards, Brian Are you linking in the test.lib? "Brian" <Brian8701@gmail.com> wrote in message news:1149849263.306233.29971...

Sandard dll
Hi I used the wizard from VS.NET to create a sample MFC standard dll in c++ (see code below). I have added 2 functions (metodo1 and metodo2) and the dll compiles just fine. When i try to call the functions in vb.net i a exception complaining there are no entrypoint defined. What i am missing to make it work? Kind Regards Jorge <dll.def> ; dll.def : Declares the module parameters for the DLL. LIBRARY "dll" EXPORTS ; Explicit exports can go here metodo1 metodo2 @1 <dll.cpp> // dll.cpp : Defines the initialization routines for the DLL. // #include "std...

OE could not be started; How to initialise MSOE.DLL?
I got error message "Outlook Express could not be started because MSOE.DLL could not be initialised. Out Express may not be installed correctly. What to do? "Me2!" <Me2!@discussions.microsoft.com> wrote in message news:7FC38848-6223-4A61-815D-5149DC45DA39@microsoft.com... >I got error message "Outlook Express could not be started because MSOE.DLL > could not be initialised. Out Express may not be installed correctly. > What > to do? This newsgroup is for support of Outlook 97/98/2000/2002/2003/2007 from the Office suite of products. Outlook Expre...

DLL injection with Vista
I've still no Vista installed. As I read here and there I haven't missed much though. Well, sooner or later I'll need to do do test my programs. There is at least one candidate which might be problematic. That one injects code into other apps to read data from them using systemwide hooks. It is well tested and runs fine under XP and is only in my private use 'til today. Can anybody tell if there are problems to expect with Vista? TIA, Hans I forgot to say that I guarantee 100% that it's neither a virus nor any other kind of malware. Hans-J. Ude <news@hajue-ude.de> ...

Export emails and address book
How do I export emails and address book from Outlook Express on laptop with Win ME to Outlook on desktop with Win XP with no cables involved? Is there a step-by-step guide? Thanks First you'll need to copy all of your Outlook Express data to the desktop computer (you'll have to use a CD or something if you can't network the machines somehow) and import it into Outlook Express there. If you need help with that step, go to http://insideOE.tomsterdam.com for complete instructions on backup and restoration of OE data. Once you have the OE files established on the desktop machi...

Exporting from a Public folder
Quick question. I have some task lists posted in a public folder that I want to export. If I try to export from the outlook client - I don't have the option to select anything other than something local. If I go to the exchange server 2000 - I don't see any option to export. This is the first time trying to do this....can someone lead me in the right direction. Thank you. not sure what you mean...if you select the folder, and do an export to file, you should be able to put the PST file anywhere...? -- Susan Conkey [MVP] "Multitasker" <Multitasker@discussions.mi...

Creating Modeless dialogs in a DLL
Hi I created a MFC regular DLL using the classwizard I am loading the DLL from a console based Win32 Application In the InitInstance of the CWinApp derived class of the DLL, If I try to create a Modeless Dialog , The dialog seems to be created, but it does not respond to any inputs and non of the controls over it are visible How do I make this work? Basically, I need a dialog box in the DLL just to catch user defined windows messages posted by another application I know for sure that the messge is being posted correctly. Is there an easier way of doing this Thanks in advanc Di. ...

Exporting data
Someone, please help. I have a large body of email I wanted to save on a CD. Rightly or wrongly, I thought I could use the "export" function to do this -- expecially when the "Help" feature told me that I could export to Word. So, I highlighted the mail folder I wanted to export, pulled down the File menu and chose Export. Imagine my surprise when Word was not among the listed options! I decided to go ahead and perform the procedure anyway, just to see what I got. I chose "comma separated values" format for Windows. Something happened. It only took me ...

NAND Flash driver : flashmdd.dll and PDD don't load
Hello, I have a NAND Flash driver developed with MDD/PDD architecture. I have the following registry settings : [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NAND_Flash] ; @CESYSGEN IF FILESYS_FSREGHIVE "Flags"=dword:1000 ; @CESYSGEN ENDIF FILESYS_FSREGHIVE ;"Dll"="nandfmd.dll" "Dll"="flashmdd.dll" "FlashPddDll"="nandfmd.dll" "Prefix"="DSK" "Profile"="FlashDisk" "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" "Fri...

DLs exported to PST files are emptied.
Hello, We have an Exchange server mailbox whose Contacts folder contains many distribution lists. Some of the lists contain other lists, and some of the lists have hundreds of members. I need to copy the entire Contacts folder to another mailbox on an isolated network. However, when I export to PST and import the PST file in the other company, the lists are practically all empty. Anyone know why this is happening? Is there an alternative format to PST files? Thanks, - Alan. ...

help with a DLL open file problem!!!
I use MFC to build an COM and it used stdio file to open and write to a file, howeever, it used to run OK on all machines, now we put it on one clinet's machine, the problem is: it can't return the file. I make the code as simple as CStdioFile file; if (file.Open(_T("C:\\DLL.log"), CFile::typeText|CFile::modeCreate|CFile::modeWrite|CFile::modeNoTruncate)) { file.SeekToEnd(); file.WriteString("Before registration!"); file.WriteString("\n"); file.Close(); } *nRes=1; return S_OK; This to test, but the function doesn't return anything. Anyone can he...

Exporting Outlook Calendars
I am currently trying to export the outlook calendar to MS Word, MS Excel, Adobe Acrobat, or any other common program that can be used to view the file. The problem is I cannot export the file in the calendar format, instead the only option is to export as a data type file (i.e. csv or tab delineated). Is this export or print to file option possible? ...

osetup.dll digital signature does not validate or is not present
When I click on the setup icon on the disk I receive the following error message: E:\proplus.ww\osetup.dll digital signature does not validate or is not present. Any suggestions? Disc is corrupt. Get a new disc to install office "Janine" wrote: > When I click on the setup icon on the disk I receive the following error > message: E:\proplus.ww\osetup.dll digital signature does not validate or is > not present. Any suggestions? > "Sudhi" wrote: > Disc is corrupt. Get a new disc to install office > > "Janine" wro...

Clearing Exported Information
I have exported messages and addresses in Outlook and then imported them again, but is there a way to clear that information now? I need to redo this function but all the original messages are still there. Thanks! Hello Secelia. Secelia wrote: > I have exported messages and addresses in Outlook and then > imported them again, but is there a way to clear that > information now? I need to redo this function but all the > original messages are still there. Thanks! As I know you have to delete them manually. Ciao Roberto ...

How to Export delivery restriction information to CSV/Excel
Hi, Anyone knows how to export delivery restriction information to CSV/ Excel format? Our organization with 3000+ mailbox, it is impossible to do it manually. Please advise. Thanks simmyho76@gmail.com wrote: >Anyone knows how to export delivery restriction information to CSV/ >Excel format? Use CSVDE.exe to create a csv file with the information in it. >Our organization with 3000+ mailbox, it is impossible to >do it manually. Please advise. > >Thanks -- Rich Matheisen MCSE+I, Exchange MVP MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm Don't send ...

OM19.dll
The hotsync software for my PDA keeps giving me the error message, cannot start MS Outlook a required component is missing OM19.DLL Install MS Outlook again. I have tried reinstalling and I get the same message. Paul ...