Acessing function with a DLL which has be loaded from another dll

I have A.dll and B.dll.

Assume that A.dll has following functions:
A1()
A2()

Assume that B.dll has following functions:
B1()
B2()

I am loading B.dll from function A1() in A.dll.After Loading B.dll i
make a call to B1().After executing the call the function returns to
beginning of A2.dll.

why is this so?

0
5/14/2007 11:25:18 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
548 Views

Similar Articles

[PageSpeed] 8

Define "begining".  The word tends to make no sense in this context.

What you seem to be saying is that you have

void A1()
    {
     HANDLE h = ::LoadLibrary(_T("B.DLL"));
     ...test for h==NULL, deal with error
    typedef void (*B1)() B1Proc;
    B1Proc B1;
    B1 = ::GetProcAddress(h, "B1");
    B1()
    ::FreeLibrary(h);
   }

if this is not what you are doing, please clarity.
				joe

On 14 May 2007 04:25:18 -0700, nani <prasad.pillu@gmail.com> wrote:

>I have A.dll and B.dll.
>
>Assume that A.dll has following functions:
>A1()
>A2()
>
>Assume that B.dll has following functions:
>B1()
>B2()
>
>I am loading B.dll from function A1() in A.dll.After Loading B.dll i
>make a call to B1().After executing the call the function returns to
>beginning of A2.dll.
>
>why is this so?
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
5/14/2007 1:15:49 PM
nani wrote:
> I have A.dll and B.dll.
> 
> Assume that A.dll has following functions:
> A1()
> A2()
> 
> Assume that B.dll has following functions:
> B1()
> B2()
> 
> I am loading B.dll from function A1() in A.dll.After Loading B.dll i
> make a call to B1().After executing the call the function returns to
> beginning of A2.dll.
> 
> why is this so?
> 

If a function returns to the wrong place it means the stack has been 
corrupted or misused.  (The return address is stored in the stack.) This 
occurs when the caller and callee do not use the same specifications for 
the function's calling convention and/or parameters.  Make sure that 
both DLLs use a shared .h file that defines the function signature. 
Also make sure that both DLLs are compiled with the same compiler in the 
same mode (debug or release).

-- 
Scott McPhillips [MVP VC++]

0
Scott
5/14/2007 1:19:34 PM
Reply:

Similar Artilces:

Double click on chart column to get another chart
Hi...I have a column chart...what i did like to do is if the user clicks on the column, there will be another chart that will come up...if he clicks on the second column chart there would be a third chart that wil come up... Basically i have data at Regional level, zonal level and then at city level.... can you help? Nikhil One way of getting dynamic charts is with AutoFilter. Have all the data on one worksheet with columns to represent Regional level, Zonal level and City level. All rows of data would be Regional, Zone name against the data for specific zones and City name agains...

MULTINOMIAL function
Can anyone tell me how to go about getting the multinomial function (Office 2000 Pro)? Help tells me to run the Setup program but I can't see how to do this. Check the "Analysis Toolpak" (ATP) box via Tools > Add-Ins Chip Pearson's page has details on the ATP at: http://www.cpearson.com/excel/ATP.htm -- Rgds Max xl 97 --- GMT+8, 1� 22' N 103� 45' E xdemechanik <at>yahoo<dot>com ---- "Andy1973" <andy.archard@btinternet.com> wrote in message news:csrri0$fei$1@hercules.btinternet.com... > Can anyone tell me how to go about gettin...

Procedure for migrating GP to another server
Hi all, Can some one suggest if there is any procedure document for migrating the Great Plains application from one server to another. Both models might be same. Few things like IP address change procedure, data migration procedure etc. Thank You SV Hi SV, Try techknowledge 878449. That is what I use to move servers. Cheers, Joe Christensen "SV" wrote: > Hi all, > > Can some one suggest if there is any procedure document for migrating the > Great Plains application from one server to another. Both models might be > same. Few things like IP address c...

error during loading crystal report in CRM
Hi, having created a new report in the crystal report designer, I get an error when the report is included in the Microsoft CRM. The error has the following content: "Fehler beim Laden der Datenbankinformationen" or "Error during loading databaseinformations" I have connected to the database with an OLE DB ADO connection. In the designer this works fine but in the Microsoft CRM system the error occurs. I belive the way of connecting is the problem and a possible solution could be to use the so called microsoft CRM connector. My question is: Is this the right idea and whe...

Changing Functional Currency #6
Dear All, I have a company Setup with US$ as Functional Currency and I need to change the Currency to CAD. How to change the Functional Currency for a company which is already assined with a Currency and transactions are entered for that currency? I have posted all the Open Transaction in GP and tried changing the functional currency but it pops me the message "Activity for this currency already exists. The functional currency can't be changed." Can any one guide me how to solve this issue. Regards, Shan You cannot, once you set the functional currency you cannot change...

Can you move two parts of one worksheet independently of another .
I want to be able to move two halves of one worksheet independently of each other. I.e. I have data in A-N and more data in O-U, and want to scroll them at different rates. Right now, I am spending a lot of time scrolling up nad down and cutting and pasting... Any ideas would be appreciated. I think that the closest you'll get is: Window|new Window. then window|arrange|vertical Then resize both windows to show only what you want (A:N and O:U). When you're tired of this view, select the window you don't want and hit ctrl-w. Any chance you could move the data in O:U into a...

Abbreviating a function
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi All, <br><br>I'm using look-up tables to translate one kind of value into another, such as letter grades to numerical grades, and as part of the look-up procedure, I use expressions like this <br><br>=HLOOKUP(E5,LetterToNumber,2,FALSE) <br><br>That is, I'm using a function with four arguments, but three of these are always the same---I'm always using the same lookup table, here references as &quot;LetterToNumber&quot;, and the other two arguments stay the sam...

Tracked changes function misbehaving
I have a simple workbook (2002) in which the Track Changes feature is enabled. End users have reported periodic problems with the contents of cells "mysteriously" changing. In process of investigating these, have found that when tracked changes are highlighted, the comments that describe changes are not always associated with the correct cell. Example, comment on cell B114 states "Changed cell B114 from '<blank>' to '12345'". In fact, contents of cell B114 is "67890" and contents of cell B104 is actually "12345". Has anyone...

How can i move a macro from one computer to another
i would like to move a macro from one computer to another i Excel Macros live in excel workbooks. So you can just copy that workbook with the macro to the other pc and open it there. TorToms wrote: > > i would like to move a macro from one computer to another i Excel -- Dave Peterson ec35720@msn.com Or you could export the module containing the macro as a *.BAS file, email it to other computer then import to another workbook. Gord Dibben Excel MVP On Wed, 08 Sep 2004 07:05:48 -0500, Dave Peterson <ec35720@msn.com> wrote: >Macros live in excel workbooks. > >So ...

moving pst files from 1 drive to another
OL 2002 SP3 Win XP HE Hi, I would like to move my personal.pst and archive.pst files from my C: drive (running out of room) to my D: drive (lots of room.) My personal.pst is 635MB and archive.pst is 200MB. What is the best way to do this? Copy from C: to D:, change path within OL, then delete files in C:? I want to make sure that I don't break any links e.g. rules, or anything else, etc. Thanks. -- Move the files, change the paths in the Mail applet of the Control Panel then fix your rules since they will break "stef" <stef.bm@hotmail.removethis.com> wrote in me...

Array function
I am trying to get a formula to return a number if two other cells have values. Column X might have a number or a letter; Column Y will have a number. For a particular line, if there is something in Column X and Column Y, I want it to return the value of the number in column Y. I can do this with a simple IF function, but the problem I'm having is that I need the cell to add the value of every line where there is something in Column X and Column Y. I tried making an array formula but it did not work: =SUM((ISLOGICAL(H20:H403))*(ISLOGICAL (M20:M403))*(M20:M403)) Help! Cynt...

MFC Extention DLL can't create a Dialog window from own resource
Hi there. I have MFC Extention DLL which has own CDialog derived class and resource associated with it. In another application I'm trying to create this dialog by exported function of the DLL. Unfortunately in my live project this trick doesn't work. But when I created thin test project using same DevEnv (VC++ 6 SP6) it is working just fine. When I run that exported function in my live project I get Debug Assertion in afxwin1.inl line 22. void CreateCitrixWindow() { AFX_MANAGE_STATE(AfxGetAppModuleState()); Sheet_Citrix* pCitrix = new Sheet_Citrix(); pCitrix->DoModal(); ...

How can you import data from another database using query ?
I am using SQL Server 2005. I would like to import data from dbA to dbB for tblMin, but only for some of the data in tblMin. Both dbA and dbB have tblMin. So, in the import wizard, i selected "Write a query to specify the data to transfer", then I write a query like this: SELECT * FROM [dbA].[dbo].[tblMin] where symbol = 'ABC' If I do this, the import wizard creates a new table called Query, and import the data to Query, instead of importing it to tblMin on dbB. How can I import the data to tblMin on dbB ? Thank you fniles (fniles@pfmail.com) writes:...

Outlook.pst has been damaged by another application
Outlook 97 has been running fine. It was minimized on the Win NT desktop. A new user mistakenly started up Outlook Express then exited out. When Outlook 97 is started now it generates the error message: The message file C:\WINNT\OUTLOOK.PST can no longer be accessed because it has been damaged by another application. Is there a way to repair the file or recover the data? -R. Baron Try running the Inbox Repair Tool against the .PST file to see if it finds any errors. Search your drive for a file called scanpst.exe and run it. -- Jocelyn Fiorello MVP - Outlook *** Replies sent to my...

WEEKNUM() Function
I can't get this function to work. I followed MS' instructions in the Help file to no avail. A B 1 =WEEKNUM(A2,1) 2 10/28/04 The A2 cell is date formated not text. What result do you get when you try it as you described? If you are getting a #Value error in A1, try entering =iseven(2) in a cell. If that returns #Value as well then you need to install the Analysis Toolpak. To do this, in Excel go to Tools->Add-Ins, check Analysis Toolpak and click OK. If you are having some other difficulty please let us know....

Need help with an employee bonus program (worksheet function)
Hello, I would appreciate some help with a bonus structure sheet that I am having trouble with. The plan is basically this: Pay an employee based on how well they meet their expense goals. On a payable base of $2500 in a given month, I want to pay an employee 30% of that ($750) if expenses no greater than 5% over budget, 100% of that ($2500) if they are on budget, and 150% of that ($3750) if they are 5% or more under budget. My sheet looks like this. Headers are on row 1. Numbers are on row 2. A B C D E F G 5%over Even 5%under Goal Expe...

Sending Messages within an Messagehandler Function
Hi everybody. I am doing the following: void CADlg::OnAutomatic() // called by the message handler { while(1) // it isn't an endless loop but it takes some time { // do something ... ((CEdit*)GetDlgItem (IDC_SUT_NUMBER))->SetReadOnly(TRUE); while((m_connectionStatus!=CONNECT_SUT || flow.GetMsgOut(0)!=0) && !m_StopAutotest ) { int breakOut=0; while(::PeekMessage (&message,NULL,0,0,PM_REMOVE) && breakOut++<200) { // enable message communication ::TranslateMessage(&...

Nesting Functions
I'm trying to combine AND, OR, and IF for the first time, and I'm getting lost in the parentheses. Here's the broader formula I'm trying to fill in: =IF(AND(Fleet,Date Completed),1,0) where Fleet needs to be filled in with: OR($D8="HOS WH",$D8="HOS ENG") and Date Completed needs to be filled in with: AND($I8>=40179,$I8<=40209) I've tested the formulas for Fleet and Date Completed as their own logical statements, and they both work. I can't get them combined in the larger formula, though. Any assistance would be apprec...

if function?
Ok, I have a cell that I want to populate below but i don't know how to write this formula.... If K27<.85, then I want the result to be J27-Q27. But if K27>.85, then I want the result to be Q27. Can you please help me write this formula? Joann Hi Joann What if K27=.85? Maybe this: =IF(K27<0.85,J27-Q27,Q27) Regards, Per "Joann" <Joann@discussions.microsoft.com> skrev i meddelelsen news:FC3B6D28-F82E-4D05-8C39-D66F4E4058E5@microsoft.com... > Ok, I have a cell that I want to populate below but i don't know how to > write &...

Having a macro/function available in new spreadsheets
Hi everyone, I wanted to define a function that would be available in all new spreadsheets that I create from now on, so I defined a macro in the Personal workbook (Personal.xlsb) and then manually pasted the code of function I needed into the macro, such that the code of the macro looked something like this: Function functionName ... End Function After saving, hiding Personal.xlsb (from View|Hide) and restarting Excel, I noticed that new spreadsheets did not know of this new function that I created; the function was only available in Personal.xlsb itself, upon unhi...

AddJob function for printing
I'm trying to find a sample. This is another function that is not working the same on an XP machine. I'm getting error 1784: The supplied user buffer is not valid for the requested operation. code is similar to: BYTE* bBuf = NULL; cbBuf = sizeof(ADDJOB_INFO_1); bRet = AddJob(hPrinter, 1L, bBuf, cbBuf, &cbNeeded); if ( !bRet ) { error = GetLastError(); ...... etc bRet is zero value and pcbNeeded is returning the value of zero. The next step would be to call AddJob again with bBuf set to whatever cbNeeded established but the zero value triggers an 87, par...

Problem with mail in another domain
I have two domains All the users have the name@domaina.com All worked fine, the second domain only have one mailbox xxxxx@domainb.com Only one user have the smtp adresss xxxxx@domainb.com The mail to this adrees goes to the right box. The problem is with the mails received to xxxxx@domainb.com with the field to <undisclosed recipien> These mails are in the failes mail folder How can i do to sent this mails to the right box Thanks Can you explain more about what you mean by: > The problem is with the mails received to xxxxx@domainb.com with the field > to <undisclosed ...

VAL Function Error
I have been using the VAL function for a couple years with no problem in Access 2003, but have recently come across a particular sequence of letter and numbers that causes an error, which I don't understand. Based on the following input and output: Original Value Val Result 6240b10043105 6240 6240c10043105 6240 6240D10043105 #Error 6240e10043105 #Error 6240f10043105 6240 6240g10043105 6240 6240d10 6.24E+13 6240d100 6.24E+103 6240d1001 #Error Why do the original values with 'e' or 'd' in the 5th character error if the le...

Acess Form & subForms
Hi, I hope someone can help me. I have one main form, with four, at least, other forms within. The problem is: I wish to pre-select one form to suit the day of the week. Explanation: I have 8 queries based on availability. I now wish to select, based on which ever day of the week, the correct query for the particular day. If anyone can advise me on how to select the desired query i would be very grateful. Thanks in advance Exilescot "train.fan#007" <no1@home.com> wrote in message news:Xns9940590171E93no1homecom@80.5.182.99... > Hi, I hope someone can help me. &g...

VBA Functions
I am using Publisher 2002 to print membership cards with barcodes. I have successfully created the file in Publisher and the mail merge works beautifully. In order to print the barcode properly I need to use a VBA function (supplied by the barcode vendor) I am able to insert the functions in Excel with no problem (=function name (cell)). Is it possible to do that directly in Publisher on the merged field? If so how? I have been looking and I have not found the magic answer. Thanks A small child turns to Ed, and exclaims: "Look! Look! A post from Louise <anonymous@discussi...