How to export this function from my dll?

hi, all

I wrote a dll, but , it does not work correctly.
I created a Regular DLL using shared MFC DLL in vc6 and exprots one function
//  in mydll.cpp 
CString __cdecl GetStringCode(CString str1, CString str2);

CString __cdecl GetStringCode(CString str1, CString str2)
{
   //code.....
   CString strRet = ........
   return strRet;
}

//  in  mydll.def file
EXPORTS
    ; Explicit exports can go here
    GetStringCode  @1

// ----- Use it in another Dialog Based app
typedef  CString (FAR  __cdecl  *PGetStringCode)(CString str1,CString str2);
HMODULE hLibrary;
hLibrary = LoadLibrary("win98type.dll");
if(hLibrary != NULL)
{
        PGetStringCode  pGetSC = (PGetStringCode)GetProcAddress(hLibrary,    
"GetStringCode");
        if(pGetSC != NULL)
        {
	CString str = pGetSC("1","2"); 
               //Here, I debugged into the mydll, int function 
GetStringCode(str1, str2), the str1="2" , str2="", this is not right.
	FreeLibrary(hLibrary);
         }
}
So how to export this function? What is wrong here?

Thanks
0
Nicky (55)
9/28/2004 4:03:01 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
437 Views

Similar Articles

[PageSpeed] 22

"Nicky" <Nicky@discussions.microsoft.com> wrote in message
news:2FE8764A-80EA-4A73-A997-4620B997C519@microsoft.com...
> hi, all
>
> I wrote a dll, but , it does not work correctly.



DON'T MULTI-POST.

Learn how to cross-post.  It's a lot more polite

0
ndrez (136)
9/28/2004 11:14:14 AM
Oh, Sorry for that.

"Nicky" wrote:

> hi, all
> 
> I wrote a dll, but , it does not work correctly.
> I created a Regular DLL using shared MFC DLL in vc6 and exprots one function
> //  in mydll.cpp 
> CString __cdecl GetStringCode(CString str1, CString str2);
> 
> CString __cdecl GetStringCode(CString str1, CString str2)
> {
>    //code.....
>    CString strRet = ........
>    return strRet;
> }
> 
> //  in  mydll.def file
> EXPORTS
>     ; Explicit exports can go here
>     GetStringCode  @1
> 
> // ----- Use it in another Dialog Based app
> typedef  CString (FAR  __cdecl  *PGetStringCode)(CString str1,CString str2);
> HMODULE hLibrary;
> hLibrary = LoadLibrary("win98type.dll");
> if(hLibrary != NULL)
> {
>         PGetStringCode  pGetSC = (PGetStringCode)GetProcAddress(hLibrary,    
> "GetStringCode");
>         if(pGetSC != NULL)
>         {
> 	CString str = pGetSC("1","2"); 
>                //Here, I debugged into the mydll, int function 
> GetStringCode(str1, str2), the str1="2" , str2="", this is not right.
> 	FreeLibrary(hLibrary);
>          }
> }
> So how to export this function? What is wrong here?
> 
> Thanks
0
Nicky (55)
9/28/2004 5:23:04 PM
Reply:

Similar Artilces:

Export to XML exports single row only
What I did: On XML source panel of Excel 2007 added XML map, mapped to columns using ranges (i. e. A1:A1825), selected “Export” from “Developer” tab in the ribbon. Result: Output XML file contains only one record (first row from the worksheet) I’ve done this numerous times in Excel 2003 with no problem. What happens?? Please help! Thanks, Eugene ...

How to impliment Print Functionality like Paint
Hello I want to impliment Print functionality like print , I want to take print out from my MFC application whatever my logical figure display on scerrn a want to take print out with same dimension but i m not able to do this , when i set change mapping mode but at the time of actual printing the image will shrink why so ? plz tell mi step ragarding this It sounds like you have to multiply the font and x,y coordinates by a factor that equals the difference between the screen and print scales (there is a considerable difference to the physical distance of a pixel on the screen to the d...

Contacts export display X400 not SMTP
Hi all, I'm not sure if this behavior is by default or not, but when my users try to export their contacts to an Excel file, any internal (domain) contacts show the X400 address rather than the SMTP address. Is there a way to change this? I've read some about VB scripts with CDO or something, but hoping there is an alternate way. Thanks Mike -- what version Exchange? -- Susan Conkey [MVP] "Mike W." <wallmr_snowpam@gmailDOTC0M> wrote in message news:iQ72h.553254$Pi2.240974@fe08.news.easynews.com... > Hi all, > > I'm not sure if this behavio...

Export / Import Security
Ok, so I have setup my test environment again. Now I have to create security all over from scratch to define what will be used in production. Is there a way to export from the test environment and then import it into the newly upgraded installation? In both cases security has been/will be completely removed from the 8.0 install (restored on new server) before being upgraded to version 10. Dear, Security will be upgraded upon upgrading GP from GP 8.0 SP5 to GP 10.0. Converting the Security structure from GP 8.0 to 10.0 will not be an easy task. Regards, -- Mohammad R. Daoud MCP, MCBM...

Exporting Sent Email Addresses from Entourage
Version: 2004 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC Hello! I'm trying to export email addresses from an employee's Entourage, but would like to include email addresses in his "Sent Items" folder. Is there a way to export these email addresses aside from exporting the "MBOX" file, which has all the email content as well? Thanks in advance! On 3/12/08 8:49 AM, in article ee9381d.-1@webcrossing.caR9absDaxw, "Quinlisk@officeformac.com" <Quinlisk@officeformac.com> wrote: > I'm trying to export email addresses from an emplo...

Export item ID?
Hi there. Having resolved my previous EMS Data import issues, I have now moved on to more complicated things (importing supplier lists, aliases etc). However, these operations require the item ID for each item - something I don't have. Is there some way I can export these from the database so I know what item ID corresponds to each item. I have run a query in Administrator (select itemlookupcode, ID from item) which tells me this, but I haven't worked out how to export this out to a spreadsheet. Any help would be appreciated, cheers After running your query goto File menu and Export....

Exporting email in Outlook Express
I am unable to export all emails in Outlook Express. First it had an error message mentioning MAPI so i followed the instructions on Microsoft Knowledge Base to install Windows Messaging - now when i try to export the following error message is: MAPISP32 caused an invalid page fault in module KERNEL32.DLL at 0187:bff7b9a6. Does anyone know what this means? tania jackson <tania@realtime-bs.com> wrote: > I am unable to export all emails in Outlook Express. Ask in an Outlook Express newsgroup. -- Brian Tillman Smiths Aerospace 3290 Patterson Ave. SE, MS 1B3 Grand Rapid...

Help with Function
Hi I am very new to programming in access and would appreciate any help with the following. I have inherited and enquiries database and we want to allocate the enquiry to a showroom based on the county. Would I use a function to do this and then somehow pass the value from the county field into it for testing and then use the result in the Showroom field. I think I could write this as a sub with a select case statement but seem to remember it was more efficient to write a function if you want to use something like this on a number of events so if you need to update anything yo...

Exporting to Powerpoint
I have a small table in Excel that I am trying to export to PowerPoint, for some inexplicable reason one column was always missing even though it was specified in the range which the Macro is supposed to export. My manager is the only was able to see the value in that column and no other can replicate his success. Do you know any reason for this? We are all looking at the exact same file, why could he see something that the rest of us cannot? Tao, Why don't you simply copy and paste the whole table into a Powerpoin slide? Joh -- Message posted from http://www.ExcelForum.com...

Calling Addin function?
Hello, I created an addin for excel, work find when in the spreadsheet... but now I want to be able to call my functions from within VBA? The addin is loaded? How can I do this? Thanks, Brian -- Please remove the 123 from the EMAIL Address. This has been added to prevent spamming. pssssst! Here spammer, spammer, spammer. pyramid@ftc.gov, bbroder@ftc.gov, jcheezum@uspis.gov, fraud@uspis.gov Hi Brian! If you set a reference to it you can call it just like the function is in the subject workbook. Tools > References Check against your Addin. -- Regards Norman Harker MVP (Exce...

Export Image Package
I have an access application that has stored .JPG images within the database as a "Package". How can I export the image back to a normal .jpg file so that it can be read by a normal (non ole server) imaging application? ...

Export registry key
Hi, Is there an API to Export and Extract a registry key in a text format ? I need to simulate the operation that is done by the user of exporting a key (and creating a .reg file in a text format). I do not want to use RegSaveKey/RegRestorekey which work in a binary format. Yoav. I believe you will have to do this yourself. There is no Automation or exported function interface to RegEdit, and that .Reg file concept is a feature of that program. However, it shouldn't be terribly difficult to do this, using RegEnumKeyEx and RegEnumValue or the CRegKey class, use a CStdioFile object...

missing DCCEXT32.DLL and SBCMSYNC.DLL
After installing windows office xp for students and teachers on a brand new PC, and downloading cumulative updates from Office Update, I get the following messages when starting Outlook: First: The add-in "DCCEXT32.DLL" could not be installed or loaded. The problem may be resolved by using detect and repair on the help menu. Second: The add-in "C:\program files\microsoft office\office\sbcmsync.dll" could not be installed or loaded. The problem may be resolved by using detect and repair on the help menu. This worked fine when I first installed it (prior to up...

Export from Excel to Word
I have a 20 page Excel document that has a LOT of formating involved, it is text not data. Is there a way that I get it into Word without having to redo all the formatting? It is 11x17, landscape. Yes: Select the area you wish to copy. While holding the SHIFT key pull-down: Edit > Copy Picture... In the Word document, just paste. Because you have pasted a picture, the formatting will be preserved. Also because its a picture, yo can re-size it as you choose. -- Gary's Student "kath0178" wrote: > I have a 20 page Excel document that has a LOT of formating inv...

Reverse of export to database
Ave, I would like to generate a Visio drawing starting from an Access database which contains the results of an 'export to database' of an existing drawing. I found import possibilities from Excel, csv, txt files, but not from databases. I'm using Visio 2002 Professional. Greetings, Are you trying to import the data from the database tables or the database schema? If it is the database schema, run the Database modeling template (File \ New \ Database \ Database model diagram) If you want to get the data, try the "Link to Database" dialog (Tools \ Macros \ Visio Extras...

Export email addresses including aliases
Hi I have a medium organization with 5 different domains so each user has 5 to 10 email aliases. I can't find a way (an easy way) to export all email addresses into a script file so I can create accounts on our off-site anti-spam provider. DOES ANYONE KNOW HOW TO EXPORT EMAIL ALIASES IN EXCHANGE 2000 Thank you, Shawn. "Shawn" <slafferty@allcovered.com> wrote: >I have a medium organization with 5 different domains so each user has 5 to 10 email aliases. I can't find a way (an easy way) to export all email addresses into a script file so I can create accounts on o...

Converting a dialog box application into a dll
I have a dialog box mfc application and I would like to convert it into a regular or extended mfc dll. Is it possible and how? Regards Galia I forgot to indicate that that I have the original source of the dialog box. The enviroment is VC 6.0. Regards Galia "Galia" <galia@mandi.com> wrote in message news:#4VCCF5GIHA.4112@TK2MSFTNGP05.phx.gbl... > I have a dialog box mfc application and I would like to convert it into a > regular or extended mfc dll. > > Is it possible and how? > > Regards > > Galia > > Applications have a lot of "bagg...

Can I export my Publisher document into MS Word?
Does anyone know how I can export my Publisher document into MS Word? Hi Matt (matthew_removethis_@mccallister.com), in the Microsoft� newsgroups you posted: || Does anyone know how I can export my Publisher document || into MS Word? No you cannot. You can open one instance of Publisher and one instance of Word and copy/paste between the two programs, or do a CTRL+Drag and Drop between the two programs. Some formatting will be lost however. -- Brian Kvalheim Microsoft Office Publisher MVP Official Publisher MVP Site: http://www.kvalheim.org This posting is provided "AS IS" wit...

Export
Can I add a control to my form that when clicked the form will be exported to a pdf or mht file? I'm using InfoPath 2003. Thanks, Joel I put this question in the wrong place. Sorry "JoelS" wrote: > Can I add a control to my form that when clicked the form will be exported to > a pdf or mht file? I'm using InfoPath 2003. > > Thanks, > > Joel ...

Outlook export csv contacts screws up email addresses (why?)
There must be a way to prevent Outlook from screwing up email addresses upon import and subsequent export of a csv file into and out of the contacts? But how? Here's what happens consistently with Outlook 2003 on Windows XP. I import this two-line csv test file into my Outlook contacts. Note this test file contains an email address which is not in my company Exchange server (apparently). LASTNAME,FIRSTNAME,PHONE,EMAIL Bar,Foo,123-456-7890,foo@bar.com When I export these contacts, the result is a different format: "LASTNAME","FIRSTNAME","PHONE","EM...

If functions??
Im trying to create a spreadsheet file where I can input data into a column and have it insert a certain factor. For example I want to be able to input data so that if i type 70 in one column it enters .985 in the next column and if i enter 71 then 979 is entered that column and so forth. The numbers are part of a temperature correction factor for a lab test so they range from 60 to 89 degrees therefore there are about 30 if then combinations. I tried visual basic but got lost can anyone help me out with a code or point me in the right direction?? Thanks -- DBassmaker -----------------...

Morphed SKU Numbers on export to Excel
I am exporting an RMS Items report to Excel to send to my new on-line shopping cart provider. One of the pieces of data needs to be the RMS SKU #. I use a combination of 4 or 5 digit internally generated SKUs, plus the typical bar code wanded numbers where items are manufacturer barcoded. When the file opens in Excel, most of the manufacturer barcode SKUs are morphed. Some look fine, but many are morphed with decimals and letters included. The morphed ones do not appear that way in the RMS database. Any ideas?? These look fine: 84692000135 Taylor's Vintage '03 Ruby Port 8...

Interrupt heavy processing within a function when ESC is pressed
I have a problem. In my application, a user can trigger a heavy computation of various properties from a dialog window that also shows the progress with a CProgressCtrl. I do not know how to stop the processing if the user decides that the process takes too long. I have a PreTranslateMessage function that checks for ESC key, but it is useless. No matter how many times I press ESC during the computations, the PreTranslateMessage is not called until the computations are complete. Putting Sleep() inside the computations doesn't help. The whole Process sleeps and PreTranslateMessage is not c...

Export Web List
I am using Visio 2002 to capture the structure and content exsisting web sites. After that is done is there a way to export the contents of the List window into Excel or Access? Thank you for your help! Hi Pamela, When you are running the Web Diagram solution template in Visio 2002, select the "Reports" item from "Web" menu. If you have Excel installed on the machine, it will be one of the report output options. I hope this helps. -- Dick Hamilton Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights "Pa...

Mass VCard Export/Save As
How can I save multiple selected contacts as VCards? I see I can do this individually, but not en masse. My goal is to transfer my contacts to my IPod, but I can't find any freeware solutions for this. Chris google suggests : http://outport.sourceforge.net/ "Chris" <AccessCaz@pobox.com> wrote in message news:%23rA4$igzDHA.1100@TK2MSFTNGP10.phx.gbl... > How can I save multiple selected contacts as VCards? I see I can do this > individually, but not en masse. My goal is to transfer my contacts to my > IPod, but I can't find any freeware solutions for this...