Calling a dll from VC++ 6.0

I was handed a dll (created from Ada) and the header file for it
----------adadll.h---------------------------------------------------------------
extern "C" {
   char * getProcList(char * pFilePath);

-----------------------------------------------------------------------------------
In my VC++ code, I have the prototypes:
extern "C" char * __export getProcList(char * pFilePath);

and my code calls the function:
TCHAR * blah = ConvertFileExt(pFileName);
TCHAR * procList = getProcList(blah)
-----------------------------------------------------------------------------------
The code builds and runs ok.  When I get to the part of the code where 
"getProcList" is called, the program terminates.  I don't know if it is dying 
inside of the dll or on the attempt to call the function in the dll.  I have 
been told that the dll worked fine upon their testing.

The dll is supposed to be handed a file name (path + file) and return the 
names of the procedures that are declared in the file.  My calling 
application is an MFC MDI application so the procedure names and other code 
can be displayed in color.

Thank you in advance for the help.
-- 
MarkC
0
markC2004 (2)
12/2/2004 10:19:02 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
343 Views

Similar Articles

[PageSpeed] 39

    For one thing, you are passing a 'TCHAR*' to getProcList(..) when it is
expecting a 'char* '

-- 
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------

"markC2004" <markC2004@discussions.microsoft.com> wrote in message
news:7D5DF802-47A5-47C0-BC9D-9A5F18897B0A@microsoft.com...
> I was handed a dll (created from Ada) and the header file for it:
> ----------adadll.h--------------------------------------------------------
-------
> extern "C" {
>    char * getProcList(char * pFilePath);
> }
> --------------------------------------------------------------------------
---------
> In my VC++ code, I have the prototypes:
> extern "C" char * __export getProcList(char * pFilePath);
>
> and my code calls the function:
> TCHAR * blah = ConvertFileExt(pFileName);
> TCHAR * procList = getProcList(blah);
> --------------------------------------------------------------------------
---------
> The code builds and runs ok.  When I get to the part of the code where
> "getProcList" is called, the program terminates.  I don't know if it is
dying
> inside of the dll or on the attempt to call the function in the dll.  I
have
> been told that the dll worked fine upon their testing.
>
> The dll is supposed to be handed a file name (path + file) and return the
> names of the procedures that are declared in the file.  My calling
> application is an MFC MDI application so the procedure names and other
code
> can be displayed in color.
>
> Thank you in advance for the help.
> -- 
> MarkC


0
CheckAbdoul
12/2/2004 11:18:40 PM
Changing all TCHAR's into char's did not change anything.  When calling 
getProcList (which is defined in the dll), I get errors:
Loaded '[mypath]\debug\adadll.dll', no matching symbolic information found.
The thread 0x8C8 has exited with code 1 (0x1).
The thread 0x8A8 has exited with code 1 (0x1).
The thread 0x984 has exited with code 1 (0x1).
The thread 0x94C has exited with code 1 (0x1).
The program '[mypath]\Debug\MDIDEMO.exe' has exited with code 1 (0x1).

I can see the file adadll.dll exists in the directory.


"CheckAbdoul" wrote:

>     For one thing, you are passing a 'TCHAR*' to getProcList(..) when it is
> expecting a 'char* '
> 
> -- 
> Cheers
> Check Abdoul [VC++ MVP]
> -----------------------------------
> 
> "markC2004" <markC2004@discussions.microsoft.com> wrote in message
> news:7D5DF802-47A5-47C0-BC9D-9A5F18897B0A@microsoft.com...
> > I was handed a dll (created from Ada) and the header file for it:
> > ----------adadll.h--------------------------------------------------------
> -------
> > extern "C" {
> >    char * getProcList(char * pFilePath);
> > }
> > --------------------------------------------------------------------------
> ---------
> > In my VC++ code, I have the prototypes:
> > extern "C" char * __export getProcList(char * pFilePath);
> >
> > and my code calls the function:
> > TCHAR * blah = ConvertFileExt(pFileName);
> > TCHAR * procList = getProcList(blah);
> > --------------------------------------------------------------------------
> ---------
> > The code builds and runs ok.  When I get to the part of the code where
> > "getProcList" is called, the program terminates.  I don't know if it is
> dying
> > inside of the dll or on the attempt to call the function in the dll.  I
> have
> > been told that the dll worked fine upon their testing.
> >
> > The dll is supposed to be handed a file name (path + file) and return the
> > names of the procedures that are declared in the file.  My calling
> > application is an MFC MDI application so the procedure names and other
> code
> > can be displayed in color.
> >
> > Thank you in advance for the help.
> > -- 
> > MarkC
> 
> 
> 
0
markC2004 (2)
12/2/2004 11:55:12 PM
Hello Mark,

I don't find the strait answer to your problem.  I got few points for
your problem.



1. You are using a dll created from ada language. You are loading the
dll in to your application.  Here I don't know ada.  Does the dll
created by ADA is using Debug option. If it is a case, the system try
find the debug symbols for the dll and failed to get them if ada not
installed or not supported in your PC.

2. From the debug information, it is loading the dll. Here I have one
question. You are passing TCHAR version of strings to the dll. Is
unicode defined in your project. If it is, can ADA handle the unicode
stub.

3. If it is problem with the finding the function, you may try to get
the function address by using GetProcAddress API. If it fails mean the
the system failed to find out the function exported in the dll.

4. You are using extern keyword to locate the function in the dll. Do
you have included the library file for your dll in to the project.

Please look into above aspects and let me know. 

awaiting for your favorable reply. WISH YOU BEST.


"I can not open the door for you. How ever I have sent some keys to
you. Try them first"

Thanks & Regards

Gopal
0
12/3/2004 4:37:47 AM
markC2004 wrote:
> I was handed a dll (created from Ada) and the header file for it:
> ----------adadll.h---------------------------------------------------------------
> extern "C" {
>    char * getProcList(char * pFilePath);
> }
> -----------------------------------------------------------------------------------
> In my VC++ code, I have the prototypes:
> extern "C" char * __export getProcList(char * pFilePath);
> 
> and my code calls the function:
> TCHAR * blah = ConvertFileExt(pFileName);
> TCHAR * procList = getProcList(blah);
> -----------------------------------------------------------------------------------
> The code builds and runs ok.  When I get to the part of the code where 
> "getProcList" is called, the program terminates.  I don't know if it is dying 
> inside of the dll or on the attempt to call the function in the dll.  I have 
> been told that the dll worked fine upon their testing.
> 
> The dll is supposed to be handed a file name (path + file) and return the 
> names of the procedures that are declared in the file.  My calling 
> application is an MFC MDI application so the procedure names and other code 
> can be displayed in color.
> 
> Thank you in advance for the help.

mark,

Just a guess that you are corrupting your stack because of calling 
conventions. What declaration is the exported function?  __cdecl, 
__stdcall, etc?

You need to make sure you call it with the correct declaration.

Just a guess is that it is __stdcall while you are trying to call it as 
__cdecl

See if actually specifying the correct declaration helps.

Relvinian
0
smpres (17)
12/3/2004 6:53:48 AM
Reply:

Similar Artilces:

Task Management in CRM 3.0
Hi everybody, 1- I want to follow CRM Users Activity in my organization, but when we Assign a task to another users, it's Owner was changed and I can't know previous user resume in this Tasks. How can i follow up tasks doing and users activity about this tasks? 2- How can I inform from completing some tasks that I assigned to another users and haven't any unique field for distinguish them? -- Mohsen Ahmadi ...

over the air sync WM 6.5 smartphone calendar w/ remote Outlook 200
----- How can I over-the-air(*) two-way sync(**) the calendar of my WindowsMobile 6.5 smartphone with the calendar in my Outlook 2007 which is running in the long-distance remote 64-bit Win 7 PC in my home? ----- If necessary, I don’t mind using an intermediary such as Google Calendar or something else. (*) - - Over-the-air: Using CDMA or GSM latest generation data channel, not WiFi, not Bluetooth (**) - - Two-way-sync: Sync should be 24/7, near-real-time (few minute lag is OK), with automatic push from the phone, and with automatic or manual push from the PC. Windows/...

How to add call activity as right mouse click to Leads list
Checking to see if anyone knows how to add the Call activity (or any other activity for that matter) as a right mouse click function or as a 'More Actions' function to the Lead or Contacts list. It is a real pain to have to open every lead or contact that you call and then add an activity and then save as completed, just to record a call that you made. It would be nice to do it as a right-mouse-click function from the list of leads or contacts. Any ideas or pointers to documentation is appreciated. Thanks! Kurt ...

Rounding problem #6
I have a series of 16 and 18 digit numbers that I am trying to store and work with. If for example I have the number 1234123412341234 and I leave the field unformatted I get '1.23412E+15' which is fine. If I change the cell formatting to 'number' w/o decimals I get '1234123412341230'. What has happened to my last '4'? Why is it now a cheeky '0'? This seems to happen with all digits after and including the 16th. Any help appreciated. Mark Although Excel can represent very large numbers (up to E309), it can only do so with 15 digit precision, so ...

CRM 4.0 Error When Deleting A Record
I have upgraded from CRM 3.0 to CRM 4.0. In the mist the sql server crashed and we had to rebuild CRM by redeploying it on a fresh install, then using the Import Orgainization wizard to import the database. Now i get the following error on the CRM server box when trying to delete any record in the system. It will take several minutes before anything happens, sometimes i get an error on my screen and the record doesnt delete, other times it finally deletes after roughly 5ish minutes if not longer. Event Type: Error Event Source: MSCRMAsyncService Event Category: None Event ID: 17415 Date: 7...

CRM 4.0 Reports #3
Can MS Sql Server 2008 Reports Designer be used to modify existing MS CRM 4.0 reports? My first hurtle seems to be converting the rdl file to a rdlc file. ...

Dynamics 10.0 and VBA Form
I have created a VBA Form that is opened by clicking a button added by modifier. The form is used to select from a list of Crystal Reports that can be run from the window. In GP 9.0 the VBA Form opened on top of the GP form, with both Dynamics Form and VBA form being visible In Dynamics 10, when the form opens, it minimizes the GP window that has the button that activates the form, but only if the main Dynamics 10 menu window is not minimized. If I minimize the main Dynamics 10 Menu window, but leave the GP window visible, then click the button, the VBA Form opens on top of the GP form...

read receipts #6
If I send a message to a hotmail or aol email from Outlook & I requested a read receipt. Will the person receiving the email get a message stating I am requesting a read receipt or does that only work with email accounts that use Outlook? They *should* get a message, if the mail program they're using follows Internet standards (which state that the user have the choice as to whether to send a receipt). -- Jeff Stephenson Outlook Development This posting is provided "AS IS" with no warranties, and confers no rights "Connie" <anonymous@discussions.microsof...

For serious template programming, staying with VC 6.0 is just not an option.
hi all VC++.NET is much more standard compliant, particularly in the area of templates. For serious template programming, staying with VC 6.0 is just not an option. ? Why ? Regards Bhargav On 6 Aug 2006 22:45:21 -0700, "bhag" <bhag281@gmail.com> wrote: >hi all > >VC++.NET is much more standard compliant, particularly in the area of >templates. I would go with VC 2003 (v. 7.1) or 2005 (v. 8) and not the 2002 version, which was actually called VC.NET. >For serious template programming, staying with VC 6.0 is just not an >option. ? >Why ? Because it ha...

send/recieve #6
i cannt get anything when i click send/recieve button ...

Creating a COM object out of TLB file within an MFC Extension DLL
Hi, I am trying to create a global(!) com object (from an Automation Server) using it's olb (type library) file only. My project is an MFC extension DLL (!). I tried many ways but the DLL crashed giving me these kind of errors: "First-chance exception in SUA_Test.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception." I am trying to create a WRQ Reflection object, but I guess the problem is conceptual. Here is my code fragment (look for the "crash" comment): **************************************************** #include "stdafx.h" #include <afxd...

how we can detect the presence of hardware on Serialport COM1 in VC++
Hi guys, how r u, can u please tell me how we can detect the presence of hardware at port COM1, actually i have some idea, that in this problem we use DTD pin to detect device, but i don't know which function i used in MFC. please solve my problem. raghunandan_1081@yahoo.com wrote: > Hi guys, how r u, can u please tell me how we can detect the presence > of hardware at port COM1, actually i have some idea, that in this > problem we use DTD pin to detect device, but i don't know which > function i used in MFC. please solve my problem. you can use DCB structure to set th...

Adding CRM CAL to existing CRM 3.0 SBE
I just purchased 5 additional CALs to add to my existing CRM 3.0 SBE "Action Pack" Server that came with 10 users. I need a total of 15 licenses but I am not yet ready to upgrade to CRM 4.0 Professional. How do I add these 5 new CALs when I didn't receive a PID or Volume License Key from eOpen? Because the existing CRM server is an "action pack" install, I didn't have to register with Microsoft Dynamics to start. Hello We have the same problem. Where can I get the License-key to add additinal Users to an CRM 3.0 SBE Please Help Norbert Lang "Thiry...

Inserting MS Equation 3.0 into Visio Standard 2002 SR-1 Shapes
Hi I'm a newbie unsuccessfully trying to create a mindmap that includes putting calculus formulas from MS Equation 3.0 into the "Growing Bubble" shape. I have no trouble with standard text in the bubble and can insert the equations outside of the bubble but not inside. Can it be done? If not is there another way I can achieve my mindmap? Many thanks -- Vince ...

VB 6.0 to Access 2000 code conversion
I everybody, i'm trying to convert my Visual Basic 6.0 code, forms, etc. to an Access 2000 database. Is there a automatic converter ? Anyone knows ? Thanks ! Not really. Tony Toews lists some products that purport to be able to do this at http://www.granite.ab.ca/access/accesstovb.htm but the general consensus is that they do an incomplete job at best. There are simply too many differences in the controls available for VB forms vs. those available for Access forms. In general, you're going to be better off recreating the forms manually. (You can, of course, simply copy-and-paste ...

GP 9.0 and PDK 9.0
I am performing an upgrade of a 7.5 envinroment to 9.0. The upgrade to GP is complete. They are using PDK in 7.5 and I want to install PDK 9.0 from CD2. My question is: Where can I find any information on performing an upgrade to this product? There is no info on PartnerSource for PDK 9.0 so I do not know if I am supposed to uninstall PDK 7.5 first and then run the install of PDK 9.0. Does anyone know? Thanks! ...

Pivot Chart #6
In Pivot Chart Wizard, How do you change the "Series in" from Rows to Columns and from Columns to Rows. Thanks. Those buttons aren't available in a pivot chart. You can change the series by dragging the field buttons between the category (Row) and series (Column) areas. Anna wrote: > In Pivot Chart Wizard, How do you change the "Series in" > from Rows to Columns and from Columns to Rows. Thanks. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

get dll class
Hello All I Create A Dll Class In VB6 And I Want To Use Its functions In Access XP But Without Set Is As A Reference So Can I Use The Create Object Methode To Create It As An Object In My Form As We Use The Create Object With Excel , If Yes What The Parameters Should Be Given To THe Method And Thanks For Every One For This Help Thanks Again Rabea Khalil Developer wrote: > I Create A Dll Class In VB6 And I Want To Use Its functions In Access XP > But Without Set Is As A Reference So Can I Use The Create Object Methode > To Create It As An Object In My Form As We Use The Create O...

OMA Problem!
Goodmornig at all! I've a problem with OMA 2003... When I type http://serverip/oma the logon popup appear; I write domainname\username and password and appear this: (see the attach....screenshot.jpg) In the domain controller event viewer I've found this error: Tipo evento: Errore Origine evento: MSExchangeOMA Categoria evento: (1000) ID evento: 1507 Data: 28/07/2004 Ora: 10.16.07 Utente: N/D Computer: DOMAIN Descrizione: Errore sconosciuto durante l'elaborazione della richiesta corrente: Generata eccezione di tipo Microsoft.Exchange.OMA.DataProviderInterface.ProviderExcepti...

Templates #6
I can't download a specific template to my Excel worksheet. I have Office xp Professional and would like to know why I can't download from the side bar. It keeps telling me to insert my cd-rom and I did. I did and says that it is not the correct one. Then it says open proret.msi file and I have been searching for it and couldn't find it on my C nor D drive. Please, someone help me. This could save me from a bad grade in class. Thanks. ...

Spell Check option for crm 4.0
Hi Could you guys share your thoughts on what are the different options available for spell checking in CRM 4.0 Thank You Kind Regards Get a spellchecker for your browser. http://www.ie7pro.com/ includes spell checking amongst lots of other great features. Other addins for IE exist for this too, most produce red-squiggle underlining similar to MS Word. Make sure they have dictionaries to support your language and region (eg UK vs US English) Adam On 02/06/2010 15:16, ~Jij wrote: > Hi > Could you guys share your thoughts on what are the different options > available for spell ...

CRM4.0: Reports from other datasources than MSCRM database
Hi After upgrading a CRM-implementation from 3.0 to 4.0, all of the reports that gets information from other datasources than CRM stopped working. I guess this i related to the fact that CRM 4.0 alters the connectionstring in the reports to point to the dataconnector on the SSRS-computer. Is there any way to make these reports work? I tries with a dynamic connectionstring wich got its configuration from report parameters, but it still fails. Any suggestions are welcome (one that works are prefered) Best regards Jens Egil Evensen ...

Problem related to Dialog Box in a Regular Dll?
Hi All I have created a Regular Dll that statically links with MFC. I want to have a dialog box as a part of my dll. So i insertted a dialog box & created its coressponding classes namely : CDllDialog.h & CDllDialog.cpp. Then i created 2 more .h & .cpp classes namely MyExportClass.h & MyExportClass.cpp The code for the class is as follows: class __declspec(dllexport)MyExportClass { public: BOOL Show_Image_In_ImageViewer(char* cImgFileName, DWORD dwSectorNo, DWORD dwImageSize); }; #include "stdafx.h" #include <stdio.h> #include <iostream.h> #in...

Problem with building extension dll
I created an MFC Extension Dll project named STHDll an in the Project Settings in the Link tab I specified a different output name than the project name ( STHLibD for Debug and STHLib for Release). Now when I build the project and the linker gets on with it it says: warning LNK4070 that the out directive in the .exp differs from the output filename. Now if I use that dll in another project the sample application always searches for STHDll.dll. Can anyone provide help, please. Many regards, thanks. In your project folder, there should be a file with .def extension. In the file, if there is ...

Sharing Contacts in CRM 3.0
Hello! I am attempting to share contacts (and other entities, but contacts are my main concern right now) in a manner that allows me and another on my team to both have our contacts sync'd into Outlook and thus, our mobile phones. I've added us to a team, then shared the contacts to that team - but still only the primary owner of the contact gets the contact sync'd into Outlook. Does anyone have any advice on how to handle this issue? Thank you! Nolan hy nolan, the "sharing" event ist not available for CRM advanced functionalities like workflow manager, advance...