ask help for DLL Export Library Definition File

Hello, guys!

I got a problem when I build an MFC App which call a MFC 
Extension DLL that has implemented some API, but I don't 
know where is the problem, in DLL, in dll def file or in 
 MFC App?

the API like this:
___________________________________________________
head file 
extern "C" AFX_EXT_API long WINAPI PassThruConnect
(
unsigned long ProtocolID,
unsigned long Flags,
unsigned long *pChannelID
);

cpp file
extern "C" long WINAPI PassThruConnect
(
unsigned long ProtocolID,
unsigned long Flags,
unsigned long *pChannelID 
)
{....}
 
and its def file like this:
____________________________________________
; BSEPassThru.def : Declares the module parameters for the 
DLL.

LIBRARY      "BSEPassThru"
DESCRIPTION  'BSEPassThru Windows Dynamic Link Library'

EXPORTS
	PassThruOpen			@1 PRIVATE
	PassThruClose			@2 PRIVATE
	PassThruConnect			@3 PRIVATE
        ....
	PassThruxxxx			@14 PRIVATE


now, I directly call the API function by include the api 
head file, instead using LoadLibrary, GetProcAddress and 
FreeLibrary .
but when I linking the MFC App project, I got problem:
________________________________________________________
Linking...
testAPIContainerDlg.obj : error LNK2001: unresolved 
external symbol __imp__PassThruOpen@4
testAPIContainerDlg.obj : error LNK2001: unresolved 
external symbol __imp__PassThruGetLastError@4
testAPIContainerDlg.obj : error LNK2001: unresolved 
external symbol __imp__PassThruConnect@12
testAPIContainerDlg.obj : error LNK2001: unresolved 
external symbol __imp__PassThruDisconnect@4




by the way, when I remove the following code in API def 
file, the MFC App run prefectly
_____________________________________________________
	PassThruOpen			@1 PRIVATE
	PassThruClose			@2 PRIVATE
	PassThruConnect			@3 PRIVATE
        ....
	PassThruxxxx			@14 PRIVATE




Thanks!

0
qiudelu (16)
9/16/2003 3:15:16 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
817 Views

Similar Articles

[PageSpeed] 27

If you do not wish to use LoadLibrary and GetProcAddress, you must link 
with an import library.  However, your use of the PRIVATE keyword in the 
DEF file will prevent the functions from being included in the import 
library -- so that's a problem.

In article <07a901c37c65$55984710$a001280a@phx.gbl>, delu says...
> Hello, guys!
> 
> I got a problem when I build an MFC App which call a MFC 
> Extension DLL that has implemented some API, but I don't 
> know where is the problem, in DLL, in dll def file or in 
>  MFC App?
> 
> the API like this:
> ___________________________________________________
> head file 
> extern "C" AFX_EXT_API long WINAPI PassThruConnect
> (
> unsigned long ProtocolID,
> unsigned long Flags,
> unsigned long *pChannelID
> );
> 
> cpp file
> extern "C" long WINAPI PassThruConnect
> (
> unsigned long ProtocolID,
> unsigned long Flags,
> unsigned long *pChannelID 
> )
> {....}
>  
> and its def file like this:
> ____________________________________________
> ; BSEPassThru.def : Declares the module parameters for the 
> DLL.
> 
> LIBRARY      "BSEPassThru"
> DESCRIPTION  'BSEPassThru Windows Dynamic Link Library'
> 
> EXPORTS
> 	PassThruOpen			@1 PRIVATE
> 	PassThruClose			@2 PRIVATE
> 	PassThruConnect			@3 PRIVATE
>         ....
> 	PassThruxxxx			@14 PRIVATE
> 
> 
> now, I directly call the API function by include the api 
> head file, instead using LoadLibrary, GetProcAddress and 
> FreeLibrary .
> but when I linking the MFC App project, I got problem:
> ________________________________________________________
> Linking...
> testAPIContainerDlg.obj : error LNK2001: unresolved 
> external symbol __imp__PassThruOpen@4
0
9/17/2003 3:25:30 AM
Reply:

Similar Artilces:

Avoid File Corruptions
I split the Access file to data and front end to avoid further file corruption. Since the boss got very concerned from possible future file corruptions I would like to do the best to avoid it Will it be beneficial to start using SQL server instead to avoid any loss of data? Thank you, Samuel "Samuel" <samuel.shulman@ntlworld.com> wrote: >I split the Access file to data and front end to avoid further file >corruption. That is indeed one of the biggest causes of corruption in A2000 and newer. Each user is getting thier own copy of the FE too, right? >Since...

Changing Default Location of PST file
I often have to swap out boot (hard drive) drives. I have a second hard drive that I use just as a data drive. It would be nice if my PST file could be located on my data drive. Then any change in Outlook no matter what drive was booted on would have any/all changes kept up to date. Is it possible to change the default location of this file. Any help would be appreciated. Jerry On Thu, 26 May 2005 16:56:15 -1000, JB <jb@home> wrote: > I often have to swap out boot (hard drive) drives. I have a second hard > drive that I use just as a data drive. It would be nice if my PST file...

Outlook XP
Whenever I receive files (even txt) the only option is to save them - I do I revert back so I have to the option of opening or saving? Thanks, J Have you edited the Level1Remove registry key or are you using a tool to edit it? -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tips of the month: -Create your own fully customized Toolbar -Creating a Classic View in Outlook 2003 Subscribe to the newsletter to receive news and tips & tricks in your mailbox! www.sparnaaij.net (I changed my reply addr...

Using Another PST File
Hello, I am using MS-Outlook 2003. How does 1 access a pst file, after the "owner" of that pst file, leaves the company??? The owner of this pst file has been deleted from the server(s), but their workstation is still available, & the pst file is on the workstation. Thank you, Charles L. Phillips Does not File->Open->Outlook Data File work? --=81 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. =20 After furious head scratching, Charles L...

csv-file-lines back to excel rows and columns
Hello, My Excel-version is 2002. I am working with long lists of Attendees for courses and get them in csv-format, so all Data are in long rows with commas inbetween. But I need them in rows and columns, name under name, adress under adress and so on. Is there a Way to convert them from csv to rows and columns? Thank you rosalia You may want to post a sample (not the workbook) of how your data is laid out. And if the data is all in a long column (not row), then is each group delimited by anything (blank row)?? Or is it x rows per group? You'll get different suggestions based on the l...

File system
Hi I am havimg some problem in booting WindowCE 4.2 . The bootup failed in filesystem 1. can anyone help me how to debug the error or where area in windowce I should zoom into for susch problem The ouput of error message is given below FMD::FMD_Init FMD_ReadSector() ######## BLOCK 10 FMD_ReadSector() ######## BLOCK 10 Data Abort: Thread=8feec5d0 Proc=8e028b58 'filesys.exe' AKY=ffffffff PC=8c233c78 RA=8c233c00 BVA=04000000 FSR=00000007 Data Abort: Thread=8feec5d0 Proc=8e028b58 'filesys.exe' AKY=ffffffff PC=8c2169d8 RA=8c216a38 BVA=04000019 FSR=00000003 D...

Opening Old Excel Files
Often when I open old excel files I get a horizontal "artifact type" line at the bottom of Row 1, about @ Col. B to G. I have seen this with all versions of excel - what is it and can I get rid of it in my old excel files. Thanks, webermis Does Window/Unfreeze Panes get rid of it? Jordon "webermis" wrote > Often when I open old excel files I get a horizontal "artifact type" line at > the bottom of Row 1, about @ Col. B to G. I have seen this with all versions > of excel - what is it and can I get rid of it in my old excel files. > > Thank...

not being prompted that user has file open
One of my clients has Excel 2000 and the other Excel 2003. A file has been saved to a shared network drive. The file has a password to modify. Neither one of the users is notified when they open the file that the other has the file open. The sharing feature is not turned on. I have heard of this happening before with other users. Could this be a version compatibility issue? -- maryj ...

re help
hi i have just installed vista on my comp and all is working well im using windows mail and just wanted some more stationery so i went to down load Microsoft's own but can i find it when it installs it it does not put it into the windows mail stationery file ? why not any help ...

Commissions data base HELP
I need help programing a data base to figuare out commisions. I need a data base to multiply 0-250 by $.50 then from 251-500 by $.65 then from 501-750 by $.75 then from 751-1000 by $.85 then from 1001-1500 by $1.00 then from 1501-2000 by $1.15 and then from 2001 + by $1.25. So if someone would enter 2000 I need the data base to multiply the first 250 by $.50 then the next 250 by $.65 then the next 250 by $.75 and so on. Any suggestions will help. Thanks Jason One way: =SUMPRODUCT(--(A1>{0,250,500,750,1000,1500,2000}), (A1-{0,250,500,750,1000,1500,2000}), {0.5,0.15,0.1,0.1,0.15...

Combo box changes file on open
This a followup on a previous post why Do you want to save changes pops up when nothing has changed. It turns out a combo box seems to have something attached that changes the file. I created the box as a test using the control toolbox toolbar. I right clicked the combo box and selected properties and in the listfillrange typed in list (a named range). Now when I open the file and close it, the pop up happens. This happens on a new workbook as well. Another thing happens using a checkbox, where in another new workbook I inserted a checkbox. I right clicked on it and selected view...

Need help with error message #3
I recieve the following error message when I try to import a .csv file from my desktop to my outlook 2000. I'm not sure how to add the correct translators, or fix the error. "A file error has occured in the comma seperated values (windows) translator while initilizing a translator to build a field map" ...

Insert File Source Path in Workbook
In excel 2000 are you able to insert the files path on at the base of the workbook as say a footer? Not just the filename - the whole path eg: h:\mydocuments\excel\book1.xls Hi Carl, Not part of Excel 2000, though it was added in Excel 2002. For versions prior to Excel 2002 you need a macro. An example of a macro for Excel 2000 can be seen in http://www.mvps.org/dmcritchie/excel/pathname.htm look for "Workbook_BeforePrint" within a box. === HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/ex...

Import QIF File no totals
When I import an investment account it has no totals. I also have 401k transfers from my paycheck that go directly into cash transactions of 401k account. Transfers that were imported (transfers from cash to investment) do not deduct my cash contributions since they have no total amount (all they have is # shares and share price). Now my 401k account balance is high by the amount of my contributions (this is because if values investments by number of shares I have and then it sees that I have additional $ in contribution account. In microsoft.public.money, John wrote: >When I imp...

Manager Error 'Bad File name or Number'
I keep getting this message on one of my machines when I try to open manager. Admin and POS both open and operate fine. I have uninstalled and reinstalled twice to no avail. Any help would be much appreciated. Thanks. Open Administrator and go to File/Configuration. Check the Paths and Templates Tabs - you probably have an invalid path or filename in one of those fields. If you are using files shared on the network, you may not have permission to access the files or folders. -- Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.com ----------------------...

export email sent to dist group
I highly doubt this is possible but want to be sure. For compliance reasons my company needs to provide all email's sent from to a dist group during a specific time frame. Since dist groups aren't mailboxes, I'm guessing it can't be done. But in case I'm not aware of another way - is there a way to search and export sent emails somehow? We do have off-site compliance setup - where all these email go...but the admin who knows it won't be available for several hours and I wanted to get a jump on it. Thanks for any info- ...

Windows Mail asking for user id & password
Hi, I've been using Windows Mail since I got Vista, with no problems. A few days ago it started asking me for my user id & password, but every time I enter them it comes up with an error message: Account: 'pop.mail.yahoo.com', Server: 'pop.mail.yahoo.com', Protocol: POP3, Server Response: '-ERR [AUTH] invalid user/password', Port: 995, Secure(SSL): Yes, Server Error: 0x800CCC90, Error Number: 0x800CCC92"" I have a free yahoo email account, which I can still access via internet explorer. I have tried deleting my account and adding it ag...

Office 2000 SR-1 Installer prevents the opening of an Excel file
I have Office 2000 running XP Pro -- when I click on an Excel file, I get the Windows Installer asking me to insert the Office SR-1 disk which I no longer have inmy possession. This just started after three happy years of using Office 2000. How can I return to opening my Excel files? Hi you probably need these CDs. If you have lost them you may ask Microsoft's support to send them anew -- Regards Frank Kabel Frankfurt, Germany "Archiex" <Archiex@discussions.microsoft.com> schrieb im Newsbeitrag news:56BFF412-9D09-4739-9DAC-4BC80467A3B7@microsoft.com... > I have O...

contacts macro help!
Hi there I want to create a macro within excel that can take cells containing name, company name, telephone number and email, and add them to my contacts database in outlook should I choose to. Before it adds the data, it will need to check if the data doesn't already exist. I'm using Office XP. thanks in advance ...

Please help me i'm an idiot
I have some templates that I've been using for a year now. When I used to type a persons name in a cell, and then go to type the same name in a cell a couple of rows down in the same column, it would automatically put the whole name in after I typed just one letter. Now it doesn't do that for me. What did I do to make this stop for me, and how can I get it to do it again? -- thuma1004 ------------------------------------------------------------------------ thuma1004's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=14810 View this thread: http://www.exce...

HELP: problems using old version of Outlook....
Does anyone still use Outlook 97? I am having problems trying to setup an email account that uses POP/SMTP and also SPA for authentication for SMTP. POP/SMTP doesn't seem to be one of the available options in Outlook 97. The only email account types are MS Exchange, MS Mail, and something else but no SMTP or POP. Do I have to install some addon or plugins? It has to be brought up-to-date to be useful. Be sure you installed SR1 and SR2 and Internet E-mail Enhancement Patch (IMEP) for Outlook 97, then use the setup instructions for Outlook 98 found here: OL98: (CW) Configuring the ...

Excel 97/2000
Hi, Can someone please help me with a formula that I am having problems creating? In a folder I have 500+ 'randomly' named workbooks, plus one master workbook. The master workbook stays the same (it is the one I work with) whilst all the others will change daily. The changing workbooks all contain the same information types - that is each one is a set of contact details, with the file name being the contact name and the following example data: A1 - Address 1 A2 - Address 2 B1 - Telephone B2 - email address etc. On a daily basis, the master workbook is to collect all this data,...

Exporting a DL in Exchange 2000
how to export a distribution list in exchange 2000 to a text, or word file. I am running office XP. I've written a script to dump all group members to a text file at the link below. You can modify this to suit your needs. http://hellomate.typepad.com/exchange/2003/08/dumping_group_m.html -- Neil Hobson Exchange MVP For Exchange news, links and tips, check: http://www.msexchangeblog.com <anonymous@discussions.microsoft.com> wrote in message news:eefc01c43d60$5d218890$a601280a@phx.gbl... > how to export a distribution list in exchange 2000 to a > text, or word file. I am...

Add DLL at runtime.
I have a problem. I'm making an app in VB9 VS 2008. The app is going to be a form MDI and a menu. What I need to do is search app.path/Plugin or something like that and find ..DLLs. My DLLs will have a couple of functions. First I need the Main form to add a menuitem in the menu. This menu item should then declare an instance of a form in the DLL as an MDIchild and open the form. I have looked high and low on the internet and MSDN to find what I need without success. As I'm writing both the main program and the DLLs that make up the add-in functionality I'm th...

Corrupt connection to data file
See below for my original post and a reply, here are some more details. I installed Optlook 2003 on my new PC then copied my Outlook.pst file from my old machine to the new machine and that resulted in 2 Personal Folders appearing. I don't recall now exactly how but I managed to get rid of one of them and Outlook uses the other one (copied from old PC) just fine until I try to access the Advanced Options for the folder so I can compress the data file. By "Second Mail Folder" I mean that I have a Personal Folders where I have all my personal emails and I also have a Work Re...