Call functions in parent from a runtime loaded DLL

Hello,

I am developing a 'plugin' for a MFC-based GUI.  The plugin is also
MFC-based, and is a simple dialog.  The plugin is loaded at runtime --
i.e. the DLL is not linked and no .DEF file is used.  The user
specifies the location of a plugin.

The plugin needs to call function(s) in the main application.  Can this
be done?  I can pass a pointer to the main application to the DLL.
However, how do I tell the linker that calls like:

parent->CallFromDll

are not undefined but will be available at runtime?

Thanks

0
egrayver (2)
8/25/2006 2:03:36 AM
vc.mfc 33608 articles. 0 followers. Follow

22 Replies
638 Views

Similar Articles

[PageSpeed] 33

<egrayver@yahoo.com> wrote in message
news:1156471416.335243.157360@m73g2000cwd.googlegroups.com...
> Hello,
>
> I am developing a 'plugin' for a MFC-based GUI.  The plugin is also
> MFC-based, and is a simple dialog.  The plugin is loaded at runtime --
> i.e. the DLL is not linked and no .DEF file is used.  The user
> specifies the location of a plugin.
>
> The plugin needs to call function(s) in the main application.  Can this
> be done?  I can pass a pointer to the main application to the DLL.

You can do this if the main application has exported the methods. Typically
the app will expose its functionality thru an object model using automation.
You will then use COM to access that functionality. It all depends upon the
application for which the plugin is being written. What app is it? Does it
have an object model?

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


0
ajaykalra (6842)
8/25/2006 2:18:39 AM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:uzqMBx%23xGHA.4960@TK2MSFTNGP05.phx.gbl...

> You can do this if the main application has exported the methods. 
> Typically
> the app will expose its functionality thru an object model using 
> automation.
> You will then use COM to access that functionality. It all depends upon 
> the
> application for which the plugin is being written. What app is it? Does it
> have an object model?
>

COM automation could be overkill for a simple plug-in that only works with 
one app.  A much simpler system is to pass abstract base class interfaces:

  *** NOTE:  this is pseudo code, so ignore any syntax errors and focus on 
the intent!


Say the DLL exports a function called

  BOOL "C" __declspec(dllexport) InitPlugin (IMainApp *pMainApp);


where IMainApp is an abstract base class:

class IMainApp
{
public:
    virtual  void CallFromDLL() = 0;
    virtual  void CallFromDLL2() = 0;
    ...
};




And the main app implements the interface:

class CMainApp : public CWinApp, IMainApp
{
    ...

// IMainApp
    virtual void CallFromDLL();
     virtual void CallFromDLL2();
}


Then the main app inits the plug-in, e.g.


CMainApp::LoadPlugins()
{
   HINSTANCE hLib = LoadLibrary ( _T("theplugin.dll") );
   InitPluginFunc = GetProcAddress (hLib, _T("InitPlugin"));
   InitPluginFunc (this);
}


Now the plugin has this nice IMainApp interface to call it's host 
application.  To reciprocate, InitPlugin() could be changed to return an 
IPlugin, an interface for the main app to call the plugin:


  (IPlugin *) "C" __declspec(dllexport) InitPlugin (IMainApp *pMainApp);


Interfaces like this let you avoid exporting entire classes and the need to 
make sure compiler and version settings are the same between app and 
plug-in, etc.  You get the benefit of using classes, just like COM objects, 
but without the pain of GUID's, the registry, threading models, and all that 
complexity you don't need considering you don't need system-wide components.

-- David
http://www.dcsoft.com





0
dc2983 (3206)
8/25/2006 4:12:57 AM


"David Ching" <dc@remove-this.dcsoft.com> wrote in message
news:dNuHg.2839$yO7.2415@newssvr14.news.prodigy.com...
> "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
> news:uzqMBx%23xGHA.4960@TK2MSFTNGP05.phx.gbl...
>
> > You can do this if the main application has exported the methods.
> > Typically
> > the app will expose its functionality thru an object model using
> > automation.
> > You will then use COM to access that functionality. It all depends upon
> > the
> > application for which the plugin is being written. What app is it? Does
it
> > have an object model?
> >
>
> COM automation could be overkill for a simple plug-in that only works with
> one app.  A much simpler system is to pass abstract base class interfaces:

This has nothing to do with what is right or wrong. It *all* depends upon
the app for which the plugIn is being written. You are assuming the OP
controls the app and the plug in. The app may not export anything or
anything meaningful or provide any header file. It may not even be written
in C++. You cannot control what the app should do unless you are the one
writing the app. In that case, its really not a plug in but simply a generic
module in the project.

A good example would be Excel as the app and you are writing an AddIn.  You
as a addin writer have nothing to do with excel's code. This is how
PlugIn/AddIns are defined. All the communication with the host app is done
using Automation (COM). I dont know how OP has the set up.


--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com




0
ajaykalra (6842)
8/25/2006 4:27:12 AM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:u0lc96$xGHA.1252@TK2MSFTNGP04.phx.gbl...
>
> This has nothing to do with what is right or wrong.

That's right, it doesn't.  It's another alternative to your suggestion, 
that's all.

-- David


0
dc2983 (3206)
8/25/2006 5:02:31 AM
"David Ching" <dc@remove-this.dcsoft.com> wrote in message
news:HvvHg.10895$%j7.5036@newssvr29.news.prodigy.net...
> "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
> news:u0lc96$xGHA.1252@TK2MSFTNGP04.phx.gbl...
> >
> > This has nothing to do with what is right or wrong.
>
> That's right, it doesn't.  It's another alternative to your suggestion,
> that's all.

I thought I tried to explained that its not an alternative. There is no
CWinApp in the main app or MFC for that matter or C++. Essentially there is
no access to app source for plugin writers that includes header files. You
typically program thru a type library which has pre-defined interfaces,
events, enums etc.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


0
ajaykalra (6842)
8/25/2006 5:09:34 AM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:uFhkoSAyGHA.1340@TK2MSFTNGP05.phx.gbl...
>
> I thought I tried to explained that its not an alternative. There is no
> CWinApp in the main app or MFC for that matter or C++. Essentially there 
> is
> no access to app source for plugin writers that includes header files. You
> typically program thru a type library which has pre-defined interfaces,
> events, enums etc.
>

I don't understand the issue here.  The OP said, "I am developing a 'plugin' 
for a MFC-based GUI".  Given this, the scheme I proposed is valid and much 
lighter weight than COM automation.  I'm not saying you should never use COM 
or automation, but neither would I use it as a first choice unless simpler 
schemes wouldn't work for one reason or another.  The OP can determine if 
that's the case and act accordingly.

-- David


0
dc2983 (3206)
8/25/2006 5:44:03 AM


"David Ching" <dc@remove-this.dcsoft.com> wrote in message
news:D6wHg.10897$%j7.7628@newssvr29.news.prodigy.net...
> "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
> news:uFhkoSAyGHA.1340@TK2MSFTNGP05.phx.gbl...
> >
> > I thought I tried to explained that its not an alternative. There is no
> > CWinApp in the main app or MFC for that matter or C++. Essentially there
> > is
> > no access to app source for plugin writers that includes header files.
You
> > typically program thru a type library which has pre-defined interfaces,
> > events, enums etc.
> >
>
> I don't understand the issue here.  The OP said, "I am developing a
'plugin'
> for a MFC-based GUI".  Given this, the scheme I proposed is valid and much
> lighter weight than COM automation.  I'm not saying you should never use
COM
> or automation, but neither would I use it as a first choice unless simpler
> schemes wouldn't work for one reason or another.  The OP can determine if
> that's the case and act accordingly.

If I understood your suggestion, you proposed modifying source of main
application. For a plugin developer, this choice is typically not available.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


0
ajaykalra (6842)
8/25/2006 12:15:41 PM
Ajay Kalra wrote:

> "David Ching" <dc@remove-this.dcsoft.com> wrote in message
> news:D6wHg.10897$%j7.7628@newssvr29.news.prodigy.net...
> 
>>"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
>>news:uFhkoSAyGHA.1340@TK2MSFTNGP05.phx.gbl...
>>
>>>I thought I tried to explained that its not an alternative. There is no
>>>CWinApp in the main app or MFC for that matter or C++. Essentially there
>>>is
>>>no access to app source for plugin writers that includes header files.
> 
> You
> 
>>>typically program thru a type library which has pre-defined interfaces,
>>>events, enums etc.
>>>
>>
>>I don't understand the issue here.  The OP said, "I am developing a
> 
> 'plugin'
> 
>>for a MFC-based GUI".  Given this, the scheme I proposed is valid and much
>>lighter weight than COM automation.  I'm not saying you should never use
> 
> COM
> 
>>or automation, but neither would I use it as a first choice unless simpler
>>schemes wouldn't work for one reason or another.  The OP can determine if
>>that's the case and act accordingly.
> 
> 
> If I understood your suggestion, you proposed modifying source of main
> application. For a plugin developer, this choice is typically not available.
> 
> --
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com
> 
> 

Ajay:

Yes, if you cannot control the application code you have to make do with 
what is provided. But if you can, I agree with David that a non-COM 
abastract interface is the way to go. I do it exactly the way David 
says, with multiple inheritance (with the MFC base class in the 
left-most position).

David Wilkinson
0
no-reply8010 (1791)
8/25/2006 1:29:28 PM
> Yes, if you cannot control the application code you have to make do with
> what is provided. But if you can, I agree with David that a non-COM
> abastract interface is the way to go. I do it exactly the way David
> says, with multiple inheritance (with the MFC base class in the
> left-most position).
>

How is this possible? The only way this is possible is if you control
the main(host) app. How can you do this for example in Excel? What you
are saying is the way to go but its just not possible in a PlugIn
unless the host application supports it. 

---
Ajay

0
ajaykalra (6842)
8/25/2006 1:34:02 PM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:1156512842.675164.314440@i3g2000cwc.googlegroups.com...
>
> How is this possible? The only way this is possible is if you control
> the main(host) app. How can you do this for example in Excel? What you
> are saying is the way to go but its just not possible in a PlugIn
> unless the host application supports it.
>

The wording of the original question left open the possbility that the OP 
was designing the plug-in system for both the app and the plug-in.  If so, I 
put forth an idea that has advantages over the standard "use COM".  If the 
situation matches the OP's, they are free to use it.  If not, good luck with 
the hassles of COM.

-- David


0
dc2983 (3206)
8/25/2006 1:48:01 PM
> The wording of the original question left open the possbility that the OP
> was designing the plug-in system for both the app and the plug-in.

I did not assume that. If you have control over what main app is, you
can treat it like another module in a project. But thats not how you
design a plugin. Keep in mind that plugins developers are not
necessarily C++ developers. For a plugIn, you always communicate thru
COM. Main reason for that is the support of other language(s) besides
C++, eg VB.

I have no idea how the setup is. After developing/designing
PlugIn/AddIns for over 3 years, I gave my input as how it is done in
commercial world. COM is tough and convoluted but thats how PlugIns are
developed in all major applications, including Office, IE etc.

---
Ajay

0
ajaykalra (6842)
8/25/2006 1:58:21 PM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:1156514301.406229.57280@75g2000cwc.googlegroups.com...
> I did not assume that.

Well, the OP did say, "I can pass a pointer to the main application to the 
DLL," implying he had controlled the app/plugin interface.


> If you have control over what main app is, you
> can treat it like another module in a project. But thats not how you
> design a plugin. Keep in mind that plugins developers are not
> necessarily C++ developers. For a plugIn, you always communicate thru
> COM. Main reason for that is the support of other language(s) besides
> C++, eg VB.
>
> I have no idea how the setup is. After developing/designing
> PlugIn/AddIns for over 3 years, I gave my input as how it is done in
> commercial world. COM is tough and convoluted but thats how PlugIns are
> developed in all major applications, including Office, IE etc.
>

Well, Microsoft has this agenda to make it easy for VB programmers whereever 
possible.  To achieve that, they designed this icky thing called COM and 
made it extremely difficult for C++ programmers to be productive.  Since 
this is an MFC group and we don't have to assume to have anything to do with 
VB, there are other plugin approaches that cater to C++ programmers better. 
In fact, I designed one based on the description I provided, and it is now 
shipping millions of copies.

To the OP:  I guess by now you are sick of our going back and forth over the 
merits of COM vs. a more C++ approach.  Please use the one more appropriate 
to your situation.

Thank you,
David


0
dc2983 (3206)
8/25/2006 2:41:30 PM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
news:1156514301.406229.57280@75g2000cwc.googlegroups.com...
>
> I did not assume that. If you have control over what main app is, you
> can treat it like another module in a project. But thats not how you
> design a plugin. Keep in mind that plugins developers are not
> necessarily C++ developers. For a plugIn, you always communicate thru
> COM. Main reason for that is the support of other language(s) besides
> C++, eg VB.

Er, no. I have a similar setup - MFC application, want to develop plug-in
DLLs. The application currently exports nothing using any technology, so
*regardless* of what technology I want to use (C++ "interfaces", COM, CORBA,
anything else) I *will* need access to the source code of the application
(which I've got, so that's fine).

The plug-ins will also be in MFC and *will* necessarily be written by C++
developers, being in C++. There's no way my client will allow me to go to
all the hassle and expense of building a COM system if I don't need it, as I
don't. As I suspect the OP is, I'm looking for a C++ way to do a C++ job.

(You might ask: if I'm building the plug-ins at the same time as the
application in the same development environment, why bother with plug-ins at
all? Simple - some customers will have some features, some will have others,
the DLLs won't get shipped to the people for whom they are not relevant.)

--
Tim Ward
Brett Ward Limited - www.brettward.co.uk


0
tw2 (223)
8/25/2006 2:42:43 PM
Hi Ajay,

I don't think David was making any assumptions.  He was only offering up 
another idea based on a possibilty that wasn't clearly spelled out in the 
original post.  I thought it was interesting.  Frankly, I'd stay away from 
COM for trivial stuff whenever possible especially if I have control over 
all of the components of the applications and they are mostly single (or 
low) use.

Tom

"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:1156512842.675164.314440@i3g2000cwc.googlegroups.com...
>> Yes, if you cannot control the application code you have to make do with
>> what is provided. But if you can, I agree with David that a non-COM
>> abastract interface is the way to go. I do it exactly the way David
>> says, with multiple inheritance (with the MFC base class in the
>> left-most position).
>>
>
> How is this possible? The only way this is possible is if you control
> the main(host) app. How can you do this for example in Excel? What you
> are saying is the way to go but its just not possible in a PlugIn
> unless the host application supports it.
>
> ---
> Ajay
> 


0
tserface (3861)
8/25/2006 3:07:43 PM
> The plug-ins will also be in MFC and *will* necessarily be written by C++
> developers, being in C++.

Thats the key here. You are forcing it to be written in C++. I did not
make this assumption.

> There's no way my client will allow me to go to
> all the hassle and expense of building a COM system if I don't need it,

Thats fine. There is nothing wrong in it. Keep in mind that none of the
major commercial products do it like this.

> As I suspect the OP is, I'm looking for a C++ way to do a C++ job.

I have no idea what OP is doing. If you read my first response, you
will find that I recommended what you have suggested. Usng Automation
was sited when OP does not control the source.

---
Ajay

0
ajaykalra (6842)
8/25/2006 4:00:48 PM
> Well, Microsoft has this agenda to make it easy for VB programmers whereever
> possible.  To achieve that, they designed this icky thing called COM and
> made it extremely difficult for C++ programmers to be productive.  Since
> this is an MFC group and we don't have to assume to have anything to do with
> VB, there are other plugin approaches that cater to C++ programmers better.
> In fact, I designed one based on the description I provided, and it is now
> shipping millions of copies.

I think I did not make myself clear enough. It has absolutely *nothing*
to do with VB. Nothing. If OP is writing a PlugIn for an app which has
an object model, OP *HAS* to use COM unless the application exports
what OP needs OR OP controls the source of the host application. That
means if OP is using MFC for a IE/Office/Autodesk PlugIn, OP will be
using COM. There is no choice.

I did not assume that OP was the plugIn developer as well as the main
application developer. 

---
Ajay

0
ajaykalra (6842)
8/25/2006 4:16:29 PM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:1156522589.383928.183910@m79g2000cwm.googlegroups.com...
>> Well, Microsoft has this agenda to make it easy for VB programmers 
>> whereever
>> possible.  To achieve that, they designed this icky thing called COM and
>> made it extremely difficult for C++ programmers to be productive.  Since
>> this is an MFC group and we don't have to assume to have anything to do 
>> with
>> VB, there are other plugin approaches that cater to C++ programmers 
>> better.
>> In fact, I designed one based on the description I provided, and it is 
>> now
>> shipping millions of copies.
>
> I think I did not make myself clear enough. It has absolutely *nothing*
> to do with VB. Nothing. If OP is writing a PlugIn for an app which has
> an object model, OP *HAS* to use COM unless the application exports
> what OP needs OR OP controls the source of the host application. That
> means if OP is using MFC for a IE/Office/Autodesk PlugIn, OP will be
> using COM. There is no choice.
>
> I did not assume that OP was the plugIn developer as well as the main
> application developer.
>

OK, we get it!  :-)

-- David 


0
dc2983 (3206)
8/25/2006 4:49:08 PM
>
> OK, we get it!  :-)
> 

<coughing> Mission Accomplished..... 

---
Ajay

0
ajaykalra (6842)
8/25/2006 4:53:25 PM
Yeah, we get it... next thread.

Tom

"David Ching" <dc@remove-this.dcsoft.com> wrote in message 
news:8SFHg.12855$kO3.1559@newssvr12.news.prodigy.com...
>>
>
> OK, we get it!  :-)
>
> -- David
> 


0
tserface (3861)
8/25/2006 5:49:01 PM
Thank you all for the various suggestions.  My original post was not
entirely clear.

I have control over both the calling application and the plug-in DLL
code.  The calling application has a number of functions that I want to
call.  I guess I could send them to the DLL one at a time by passing
the function pointers to a function exported from the DLL.

However, I'd like to 'import' the functions in the calling application
from the DLL.

Can I used the 'GetProcAddress' to get at functions in the calling
applications?  What would I used for the handle?

Thanks,

Eugene.

egrayver@yahoo.com wrote:
> Hello,
>
> I am developing a 'plugin' for a MFC-based GUI.  The plugin is also
> MFC-based, and is a simple dialog.  The plugin is loaded at runtime --
> i.e. the DLL is not linked and no .DEF file is used.  The user
> specifies the location of a plugin.
>
> The plugin needs to call function(s) in the main application.  Can this
> be done?  I can pass a pointer to the main application to the DLL.
> However, how do I tell the linker that calls like:
>
> parent->CallFromDll
> 
> are not undefined but will be available at runtime?
> 
> Thanks

0
egrayver (2)
8/28/2006 6:13:27 PM
egray...@yahoo.com wrote:
> Thank you all for the various suggestions.  My original post was not
> entirely clear.
>
> I have control over both the calling application and the plug-in DLL
> code.  The calling application has a number of functions that I want to
> call.  I guess I could send them to the DLL one at a time by passing
> the function pointers to a function exported from the DLL.
>
> However, I'd like to 'import' the functions in the calling application
> from the DLL.
>
> Can I used the 'GetProcAddress' to get at functions in the calling
> applications?  What would I used for the handle?
>

Why use GetProcAddress? Since you have the app and the plugIn, just
export the methods from the app and import these in PlugIn. 

---
Ajay

0
ajaykalra (6842)
8/28/2006 6:19:41 PM
If it is MFC-based, don't use callbacks.  Use messages.  They're much cleaner.

..DEF files have to do with the construction of the DLL, not its use, so I have no idea why
you would be concerned about the .DEF file.  

Doing callbacks in C++ is very hard, and generally not worth doing if you can avoid it.  

What is "CallFromDll"?  WIthout knowing the data types involved, it is impossible to tell
what is going on here.  However, there is no way to call a method in a callback class
unless it is static.  My attitude has been "why bother?"  Callbacks generaly represent an
old paradigm of thought, applicable to some low-level APIs (and many of those are done so
badly they are nearly unusable), but trying to call C++ methods of a class is generally
such a wrong approach that you shouldn't even bother.
					joe

On 24 Aug 2006 19:03:36 -0700, egrayver@yahoo.com wrote:

>Hello,
>
>I am developing a 'plugin' for a MFC-based GUI.  The plugin is also
>MFC-based, and is a simple dialog.  The plugin is loaded at runtime --
>i.e. the DLL is not linked and no .DEF file is used.  The user
>specifies the location of a plugin.
>
>The plugin needs to call function(s) in the main application.  Can this
>be done?  I can pass a pointer to the main application to the DLL.
>However, how do I tell the linker that calls like:
>
>parent->CallFromDll
>
>are not undefined but will be available at runtime?
>
>Thanks
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
8/29/2006 12:57:14 AM
Reply:

Similar Artilces:

Adding if to Average If Array function
Hi, I recently had help understanding the following formula {=IF(ISERROR(AVERAGE(IF(Score>0,Score))),"",AVERAGE(IF(Score>0,Score)))} Thanks to Luke M, Pete UK and David Biddulph who provided the explanation. I've now been asked to add to this formula so that if either Q3 or Q4 is greater than 4 then the average cannot be lower than 3. Q1:Q35 is the named range score. This is really complicated because I still need to have an average and I'm thinking that the If part is non array but the average part still needs to be an array. Can you mix and match ...

I am looking for a function for linear interpolation
I am looking for a function for linear interpolation Look in HELP for the LINEST() function -- Kind regards, Niek Otten Microsoft MVP - Excel "azad" <azad@discussions.microsoft.com> wrote in message news:C53A752C-DF76-4B9F-9145-6F39495088B7@microsoft.com... >I am looking for a function for linear interpolation ...

Can I use the NOW() function in a formula?
I have a cell B1 that has NOW() time and another cell B2 that has NOW() date. I am trying to have data from another cell F1 brought in to the destination cell B3, when a given date and time occur. =(IF(AND(B1="23:00:00",B2="12/03/2009"),F1," ") This formulas does not work. The Clock is continuously active / always changing. Any suggestions would be appreciated. Thanks. The NOW() function returns both a date and a time. Even if you format the cell to display only date/time, all the data is still retained. NOte that if you did want just the d...

MSCRM Call Scheduling Add-on
Does anyone know of any add-on to CRM 4.0 that will help my call center staff better schedule their calls? If they each manage, say, 500 accounts, then what I want is a regular 45-day call schedule and a nice easy-to-digest view in CRM that shows them which calls they need to make for the day etc. ...

Slow load of first node, xmltextreader
Hi! I have a problem with reading a xmlfile from a url. I am confused by the long loading time of the first node. When the first node has been loaded, the rest of the nodes is parsed very fast. I am on a c# 2003 environment. The url returns an xml of appr 80 kB. It takes 1,5 seconds from first,start to first, stop. It takes appr. 0,5 seconds to generate the xml on the remote host. I'll be very happy for any assistance on this! /fredrik // Gets the xml from the Url using XmlTextReader Trace.Write("init reader","start"); XmlTextReader reader = new XmlTextReader(sea...

Sum function
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I am trying to put together a spreadsheet for a business plan and am having problems with the autsum and autofill functions. Firstly, even though I do a simple autosum, if I change a value in a cell, the sum does not change. Secondly, if I try to autofill across columns, the values of those columns simply mirror the value of the first. In other words it copies it. I am at a loss how to get round it as I have been working w Excel for years and have never had this problem. I have experimented with a new worksheet with ...

Need help with correct function or input for this problem/scenario
I have a situation where I am creating a borrowing base for a company. (I am going to shorten numbers to make it easier.) There is a $300 loan. Type A loan can borrow up to $300. Type B loan can borrow up to $150. Type C loan can borrow up to $50. I need a formula to input in excel that will give me a borrowing base for type B and C loans. For example, to borrow in type B loans, I have to check 1-what's outstanding on the entire loan. 2-what's outstanding on type B loans. 3-Take those two numbers and figure out what can be advanced under the answer to those questions. (I.E. $2...

sum function usin an IF statement
Bit short on detail, but maybe =IF(rng>10,rng) as an array formula, committed with Ctrl-Shift-Enter or =IF(rng1>some_val,rng2) again an array formula, where rng1 and rng2 are the same size. -- HTH RP (remove nothere from the email address if mailing direct) "jimk" <jimk@discussions.microsoft.com> wrote in message news:2873BFCF-598E-4956-808C-31C1638741A9@microsoft.com... > ...

Using Filter string with IF function
Is there a way to use a filter string with the IF function? I have a spreadsheet that looks like this: Invoice No. Invoice Date Invoice Currency Invoice Value 1 dd/mm/yyyy USD 1234.56 65 dd/mm/yyyy USD 2345.67 74 dd/mm/yyyy EUR 3456.78 88 dd/mm/yyyy USD 4567.89 when I filter on the currency: is there a function such as if(filter_string="USD";TRUE;FALSE)??? Thanks Aref Maybe this: Assuming row 1 are t...

Loading Great Plains on Citrix
Is it feasible to load more than one instance of Great Plains on a Citrix Server? So that: First Company C:Program Files/Microsoft Business Solutions/Company1/Great Plains/ Second Company C:Program Files/Microsoft Business Solutions/Company2/Great Plains/ This is recommended if each company uses different mod forms and reports: But if this to point to company a or b - you can configure this with Great Plains security for which users can access what company when loggin into GP. Regards James "Tremor Olaes" <TremorOlaes@discussions.microsoft.com> wrote in messa...

Sum Function (was summing 13 cells to the left)
Trying to compose a formula that will only sum 13 cells to the left (13 months of data). When columns are added, I still only want to sum thirteens months of data. Can this be done without constanty changing my formulas? Make sense TIA Neil S. Hi see my reply to your old post -- Regards Frank Kabel Frankfurt, Germany Neil S. wrote: > Trying to compose a formula that will only sum 13 cells to the left > (13 months of data). When columns are added, I still only want to > sum thirteens months of data. Can this be done without constanty > changing my formulas? Make sense? ...

Another Issue With A Function
Ron Rothstein suggested and I used this function in my Excel 2003 Workbook: Public Function QBRushYds(W, Q) QBRushYds = Worksheets("Week" & W).Range("C2").Offset(Q).Value / 10 End Function In Worksheet Totals Cell B56 thru B59 I have the following four calculations: =TRUNC(QBRushYds(1,1)) =TRUNC(QBRushYds(1,2)) =TRUNC(QBRushYds(1,3)) =TRUNC(QBRushYds(1,4)) In Worksheet Week1 Cells C3 thru C6 I have the following values: 725 814 283 9 The function correctly calculates the values: 72 81 28 0 If I change any of the values in C3 th...

Another MFC extension DLL problem
I have an entry point defined like this: #ifndef BUILDING_UTILITY #define _UL_EXT_CLASS _declspec(dllimport) #else #define _UL_EXT_CLASS _declspec(dllexport) #endif void _UL_EXT_CLASS AttachToUtilityLib(LPCTSTR pszString) When I try to link the dll to another extension DLL, MyMessageBox is unresolved. If I take out the LPCTSTR parameter, it links fine. What could be wrong here? Maybe it's a name mangling issue, are this DLL's both C++ ? I assume you use different defines for your two DLL's otherwise you may have conlicts here. Cyrille Dupuydauby "David W. Simmo...

And function into If function
I´m trying to get this function to work. But I´m getting an error message. =If(and(100/I6)*I7>101); I7<I6; 1; 0) What the function is supposed to do is to detect peak values in chart table that are measure errors from a measuring intrument and count every peak as 1. This is how the function is ment to operate: If the percent of the difference of the rise from the former cell to the next cell in the sequence of data is larger than 101% AND the value of this cell is smaller than the former cell then true=1 False=0 Im using a norwegian version of excel and I´m no...

Outlook 2000
Aloha! I unfortunately, deleted a dll file on my computer. It happend when cleaning it up after a virus attack. Outlook 2000 is not installing again correctly. While attemtig it I get the error message: Failed to register a VB Script DLL. Reinstall or run Regsvr32.exe Vbscript.dll to self register. The key "DisplayName" is either missing or has an incorrect value. [File c:\Program Files\Microsoft Office\Office\Forms\1033\CNFRES.CFG, Section Description] The article which was to solve the issue is here. http://support.microsoft.com/?kbid=271141 I already followed the steps in it;...

Rank Function? #2
Why would my RANK function be returning #DIV/0! ???? Didn't know this was possible. Anybody run into this before? Thanks!! > Didn't know this was possible It isn't - so Excel is saying that you are trying to do the impossible :) Your code will probably need to check for and exclude zero values -- Message posted from http://www.ExcelForum.com ...

distribute mfc42.dll with the app?
My app crashes on win2003 server, but if it will work if I copy over an old mfc42.dll to my app directory. Is it a good idea to distribute mfc42.dll with my app? (I checked the mfc42.dll of Win XP against the one of Win2000, they seemed to be different.) Thanks. Wanjun It's OK to distribute this file, but you should localize it to your application directory so that it doesn't mess up any other applications that might get installed. You're right, there are a few versions with the same name on the DLL. Tom "Wanjun Yu" <wanjun_yu@hotmail.com> wrote in message ...

Using C# dll as COM in an MFC application
Hello, I have written a C# dll in VS2005. One interface and class are exported using Interop Services. I want to use this c# dll in my MFC application, using VS2003. It compiles after I imported the dll to my MFC app. On runtime I get class not registered HR error in my MFC project. I use the code as follow: _NewActivationPtr myActivation = NULL; HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaActivation)); I don't what to do. Do I have to use GACUtil to register? If I want to use GACUtil do I have to sign my project? Trying do it had failed, because my third party librar...

Hlookup function
I am currently creating a page that has a column of calculations in it. The calculations are amounts of Future options. at the bottom of the column I calculate an average 6 month total by simply suming 6 months into the future. The question I have is how do I automate the Total sum number at the bottom, because every time I update my worksheet I have to redo all my calculations because the previous months value is now 0 because there is no future value anymore, so I have to rename my range and do my calculation over again. I originally thought of the Hlookup function but I can't get it to ...

Basic IF function help needed
This is a multi-part message in MIME format. ------=_NextPart_000_00AE_01C71C7B.8E24F3D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm using Excel 2002 for the first time and trying to place a function = into a cell. I 'm using IF(N44=3DL, M44-L44, L44-M44) . Which is supposed to mean If the letter L is in cell N44, then subtract = number in L44 from number in M44. Otherwise subtract M44 from L44. If have 2 main questions...First, how to get the result of the function = to show. Right now I see the function typed out in...

Vista Word Loading Problem
Have had this Gateway POS for 2 years. Programs all pre-loaded,(no disks) including Windows Office Suite. Lately, after clicking on the Word icon, small screen says preparing to install and an install progress bar begins, then stops about halfway. Notice says "SKUO11.CAB could not be found". If I cancel the install, I get another message saying, Please run Set Up and select "repair" (can't find Set Up, Where to look?) If I hit cancel again, the program begins and works fine. The problem seems to be getting to the program. Any Ideas? ...

Queue info slow to load
We're using two front-end gateway servers that route email to and from the Internet, and also to internal routing and admin groups (a "hub and spoke" topology). They're more or less identical and are setup to load balance email traffic. Both are Ex2k3 on Win2k3 with all the latest service packs and updates. The back-end environment is Ex2k/Ex2k3 mixed mode. When i look at the queues for either front-end server by going through their local Exchange Administrator, one server takes a loooong time to load (a minute or more), while the other one loads the same informatio...

Calling Forms
Usually when i write a Visual C++ program i use Dialogs insted of Forms. When i want to call a dialog i use the Dialog.DoModal(), but how can i call a Form? Ricardo Furtado wrote: > Usually when i write a Visual C++ program i use Dialogs insted of Forms. When > i want to call a dialog i use the Dialog.DoModal(), but how can i call a > Form? > If you have a document/view app, what is usually done is to switch the view from one formview to another, within the same frame window. Sample code is shown at: http://support.microsoft.com/default.aspx?scid=kb;en-us;141334 -- ...

Outlook 2003 & msvcr71.dll crash
Hello all, Recently I've been getting crashes from MIcrosoft Outlook 2003 when I close it down. Outlook works fine when it's open, it runs properly, but the moment I goto shut it down, I get an error asking me to submit the data to microsoft.. When I click the link to see the conents of the error/crash I get the following: AppName: outlook.exe AppVer: 11.0.6353.0 AppStamp: 408f2937 ModName: msvcr71.dll ModVer: 7.10.3052.4 ModStamp: 3e561eac fDebug: 0 Offset: 000017fb I have not installed any software around the time that this crash started happening. In fact my syste...

How to use more than 7 IF functions in a formula?
I tried to post a question earlier but it never appeared on the messag list. Not sure if it went through. So here it is again. I am trying to set up a formula where when I type in a weight i another column it will automatically puts in an assigned value for tha weight. The problem is that the weights range from 110 through 260. have found that I cannot put in more than 7 IF functions in a formula. This is my first time trying to do something like this and I am havin problems. I know there has to be a way to do this. For example I tried this formula and it worked except I con only put ...