|
vunhutien wrote: I code an app in C# This is the C++ forum.
vunhutien wrote: Please give a sample code. Sorry, we do not provide code to order.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
I am attempting to write and OLE program to access excel workshhets
in all the examples I have seen the first statement seems to define
_ApplicationPtr e.g. EXCEL:: _ApplicationPtr ptra or EXCEL:: _ApplicationPtr ptrb
My question is where is _ApplicationPtr defined
Thanks
|
|
|
|
|
The clue is in EXCEL:: which says that _ApplicationPtr is a member of the class EXCEL.
Ergo, the definition of the EXCEL class is where you should look.
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Where would I find the class defination of excel usally when I google msdn and the class name the first hit is a defination of the class name
thanks
|
|
|
|
|
See this article[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I am working on customization of multimedia communication using SDP. Plz could you provide me with SDP code
|
|
|
|
|
mani251619 wrote: Plz could you provide me with SDP code Sorry this site does not provide code to order.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
mani251619 wrote: Plz could you provide me with SDP code Did you see #2 here?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
Hi,
I am getting a compiler error on #import statment defining the library type for excel 2003
I am using Visual C++ 6.0 The library type is in excel.exe
Which in my case resides in C:\Program Files\Microsoft office\office11
Where would I specify this directory in Visual C++ 6.0
|
|
|
|
|
You already posted this question in the COM forum; please do not crosspost.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thought nobody visited the other forum sorry
|
|
|
|
|
ForNow wrote: Where would I specify this directory in Visual C++ 6.0
Are you working in MFC, if yes then you can use the class wizard to generate the class based from OCX,TLB or DLL
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ForNow wrote: I am getting a compiler error... Which is what?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
<pre lang="text">
What is the basic difference in processing system messages in MFC?
Should I use message map or WindowProc?
In my included sample the WindowProc get executed first ( as expected ) , but I really do not do any message processing in this case. So my secondary question would be - what is considered by OS as processed message?
</pre>
BEGIN_MESSAGE_MAP(C_Setup, CDialog)
//{{AFX_MSG_MAP(C_Setup)
ON_MESSAGE(WM_DEVICECHANGE, OnMyDeviceChange)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
LRESULT C_Setup::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
//AfxMessageBox("LRESULT C_Setup::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)");
if(message == WM_DEVICECHANGE)
{
AfxMessageBox("message == WM_DEVICECHANGE");
} // TODO: Add your specialized code here and/or call the base class
return CDialog::WindowProc(message, wParam, lParam);
}
Appreciate your input.
Thanks
Vaclav
|
|
|
|
|
Why are you using a MFC message map and a Win32 message procedure? You should only be using message maps in MFC programs.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
OK, so let me rephrase it - when would one use WindowProc in MFC?
|
|
|
|
|
Less than rarely, closer to never. Even with all the knocks on MFC message maps, once you are developing with MFC, I can not think of a reason for not using the maps.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Never. MFC has an inbuilt message pump and MessageProc() handler which distributes the messages according to your MESSAGE_MAP entries. If you add your own MessageProc() then you break the connection between those entries and your message handlers.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I would agree with NEVER... use message maps in MFC. If you find it doesn't do something specific that you needs, that's when you go around the framework, other than that... it's best to try to use the framework that's there.
|
|
|
|
|
Messages use WindowProcs, but MFC handles that for you. There's really very few cases where you'd have to go around what MFC already does. Only reason to code your own WindowProcs would really be if you're doing native Win32 coding.
|
|
|
|
|
These lines are OK
if ( DBT_DEVICEARRIVAL == wParam || DBT_DEVICEREMOVECOMPLETE == wParam ) {
PDEV_BROADCAST_HDR pHdr = (PDEV_BROADCAST_HDR)lParam;
But here the compiler complains about undefined symbol.
PDEV_BROADCAST_DEVICEINTERFACE pDevInf;
All of these are defined in Dbt.h and suppose to work in XP.
<b>So, what else did I missed?</b>
Any help will be appreciated.
Cheers
Vaclav
|
|
|
|
|
1. Please put your code inside <pre> tags.
2. Show the exact code and the compiler error that you get.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
If you open Dbt.h and lookup the definition, you will see that it is enclosed by this condition:
#if(WINVER >= 0x040A)
So check your WINVER definition (usually in stdafx.h). For XP and later it should be 0x0501.
|
|
|
|
|
Thanks,
my Windows OS is XP SP3 ( 5.1) and my VC 6.0 has references only to WINVER 4.0!
I hope I can fix that without screwing things up too much.
Thanks again.
I see that WINVER is set in Windows.h by default - by checking if it is not defined -independent of OS version. I guess my expectations from OS and compiler are little to high.
-- modified 5-Dec-12 15:11pm.
|
|
|
|