|
Well my first comment is why isn't the data in the document if it is shared across views!!
If you must continue then try CDocument::GetFirstViewPosition() etc. to iterate the Doc.Views.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
well, about your comment. that what i did eventually... thanks!
|
|
|
|
|
|
Hello,
I am having a win32 dll in which there are some exported funation. i want to use the that dll from another win32 application and call its functions. How can i know the the no of parameters to be passed and its datatypes. The name of function i get from the Dependency tool of visual studio but it does not shows the no of parameters and its types.
Plz help me regarding that.
Thanks
Kuldeep
|
|
|
|
|
You can't find out the parameter list of functions in a dll. You need a description or a header file.
MS
|
|
|
|
|
how to insert Microsoft chart control into a dialog box and the make a pie chart and continuously keep updating the the chart
|
|
|
|
|
hi evrybody
i have written an app that draws graph on a window, can anyone help on how to save this graph to a bitmap to any desired location ?
what i want is that by clicking the save button a savedialog will be opened and i can choose to waht dir i want to save the bitmap , that i first of all need to know how to make. i'm working in VC++ the program is a win32 project and is written in C and C++ ,not in MFC .
thanx alot
|
|
|
|
|
|
See CxImage, CDibData and totorials.
INTP
|
|
|
|
|
Is there some way how to find out whether WM_ACTIVATE / WA_ACTIVE
was caused by call to SetForegroundWindow(), or by user ?
(Alt-Tab or clicking into task bar) ?
rrrado
|
|
|
|
|
Probably not. But make the important alternative question instead: Why would you want to know? This might lead to an answer. If it is inside an application you control yourself, for example, you can code around it. If not, the reason you want to do it might lead to a different solution.
|
|
|
|
|
hi,
i call OpenDocumentFile to open a new Doc/View, how can i make it response window?
|
|
|
|
|
Hi all.
I am trying to customize the cookie data in the http headers of my IE. That is to say I must add my own 'Cookie' header to standard IE http headers. But, each time when I use IWebBrowser2::Navigate2() function to add 'Cookie' header(such as 'Cookie: jsessionid=0DE9IIUD03D23'), the 'Cookie' header will be filtered by IE. It seems that the 'Cookie' header is maintained by IE itself and it is not changeable.
Is there any way to modify IE's 'Cookie' http header according to you need?
Any suggestion will be appreciated.Thanks very much.
Leo.
|
|
|
|
|
We have been developing a VC++ 6.0 application in Windows NT service Pack 6a OS, Which interfaces with Data collection
Hardwares(mounted in ISA/PCI slot of the computer) through their DLL's.
We have the following function call problem as follows:
Our application header files are defined as ollows:
***********************************Our application Header
file********************
#include "DLLHeader.h"// Dll definitions are included
Class OurClass
{
public:
void (*InitBoardfunction) (WORD Addr, WORD IRQNo);
WORDBOOL (*BoardIsOkfunction) (void);
: :
: : :
: : :
: : :
void (*Setfunction) (WORD set);
BOOL GetDLLPointers(void* ptr);
BOOL InitDAQ(void);
};
***********************************Our application Header
file********************
Our application Implementation files are defined as follows:
***********************************Our application Implementation
file********************
// This function gets function pointers of the DLL.
BOOL OurClass::GetDLLPointers(void* ptr)
{
HINSTANCE handle;
CString ErrMsg;
CString ErrTitle;
COurappDoc* pDoc;
pDoc = (COurapp*)ptr;
SetCurrentDirectory(pDoc-SetupEnviron.OurappInstalledDir); // Sets
the current Directory as the application Installed Dir.
handle = AfxLoadLibrary(_T"Board.dll"));
InitBoardfunction = (void(__stdcall*)(WORD,WORD)) ::GetProcAddress(handle,"InitBoardfunction");
ASSERT(InitBoardfunction != NULL);
BoardIsOkfunction = (WORDBOOL(__stdcall*)(void))
::GetProcAddress(handle,"BoardIsOkfunction");
ASSERT(BoardIsOkfunction != NULL);
: : :
: : :
: : :
: : :
Setfunction = (void(__stdcall*)(WORD)) ::GetProcAddress(handle,"Setfunction");
ASSERT(Setfunction != NULL);
return TRUE;
}
// DLL functions are getting called in this function.
BOOL OurClass::InitDAQ(void)
{
CString ErrMsg;
CString ErrTitle;
InitBoardfunction(0x300,5); // First DLL function call
: : :
: : :
: : :
: : :
Setfunction(1); // application crashes here.
}
About 8000 lines of "First-chance exception in Simple.exe (KERNEL32.DLL):
0x0EEFFACE: (no name)." messages are getting printed in Debug window,
after executing the first DLL function call (InitBoardfunction(0x300,5)) in our
application, While I am in the debug mode. After calling couple of other
DLL functions, Setfunction(1) is getting called in our application.
After executing the Setfunction(1) function call in our application,
my application crashes with the following message in the Debug mode.
"File: i386\chkesp.c
The value of ESP was not saved across a function call .This is usually a
result of calling a function declared with one calling convention with a
function pointer declared with a different calling convention."
I opened up Registers window, Disassembly window while debugging the sample code. The assembly code is as attached for
the "Setfunction(1)" function call
004036D9 8B F4 mov esi,esp
004036DB 6A 01 push 1
004036DD 8B 45 FC mov eax,dword ptr [ebp-4]
004036E0 FF 50 1C call dword ptr [eax+1Ch] //ESI register values are getting changed after this
function call.
004036E3 3B F4 cmp esi,esp
004036E5 E8 86 BF 01 00 call __chkesp (0041f670)
ESI register value is getting changed from 0012F82C to 0012F94C, after the function is getting called.
Can anyone help me by answering the following:
1. What are all the possible reasons for changes in ESI register value. Is there a problem with DLL. If it is, What
might be the problem in DLL & Please suggest what to Do for the DLL supplier to solve this problem.
2. The same typical code is working without any problem in Borland C++ Compiler. Is there any settings in VC++ to be done
to avoid this Crash.
3. How to avoid "First-chance exception in Simple.exe (KERNEL32.DLL): 0x0EEFFACE: (no name)." messages(about 8000+) in
the debug window. This message is getting printed when you call the first DLL function (InitBoardfunction(0x300,5); ) in
our application.
Also Please note that Our application is an existing application & it was working fine without any problem with an Old
DLL supplied by the supplier. Our Hardware supplier did some revisions in the DLL to make it work for both ISA as well as
PCI slot Data Acq Cards. The subject problem started there.
Please note that our application is being compiled with /Gz option as the DLL functions are written in Delphi & exported
by __stdcall function call type
Could you please help me to solve this problem in our application.
|
|
|
|
|
MutuMuru wrote:
void (*InitBoardfunction) (WORD Addr, WORD IRQNo);
WORDBOOL (*BoardIsOkfunction) (void);
: :
: : :
: : :
: : :
void (*Setfucntion) (WORD set);
Shouldn't you have __stdcall here as well, so:
void (* __stdcall InitBoardfunction) (WORD Addr, WORD IRQNo);
?
|
|
|
|
|
Thanks for your reply.
I already tried by putting the function declared as you said.
void (* __stdcall InitBoardfunction) (WORD Addr, WORD IRQNo);
But Still the error exists.
|
|
|
|
|
Hm. The code you showed would give this error. It's also typical when using DLL:s that works with Borland (due to different default calling conventions), and moreover, constistent with the error message.
Have you checked, double-checked and then triple-checked that you have really tested a version with __stdcall in the definition as well? Made a Rebuild All, made sure that the original DLL really uses the new code etc.
This might sound impertinent, but I sat the day before yesterday and debugged the same bad DLL for hours, until I realized that all the changes I made had no effect, the test-app didn't use the newly built ones
|
|
|
|
|
Yes, I checked so many times that the function definition is with __stdcall type only.
|
|
|
|
|
Could you post the updated code here instead?
|
|
|
|
|
Where can I find the API for MS Outlook 2000? Searched MSDN but know where to read…
I’m heading into automation programming in VC++ and have created wrapper classes (for msoutl9.olb)
_____________________________
...and justice for all
APe
|
|
|
|
|
The documentation for programming Outlook via C++ is very poor. Try searching MSDN for "Microsoft Office 2000 Language Reference" which gives details of Outlook object model (in VB, but it's better than nothing).
Also try looking in the Knowledge Base for article 196776.
|
|
|
|
|
I recently had to do the same thing (retrieving message objects from the user's inbox), and I used two tools: one was doing a google search on words related to what I was trying to do. the other was using the outlook helpfile that should be on your machine 'VBAOUTL9.chm'; that helped me more than anything. If there's anything specific, post it and i'll see if there's a way I can help
If it's broken, I probably did it
bdiamond
|
|
|
|
|
I've manage to created wrapperclasses and starting using automation. (I'm not really sure what it means but anyway).
I manage to run this code:
...<br />
if(!app.CreateDispatch("Outlook.Application"))<br />
{<br />
AfxMessageBox("Couldn't start Outlook.");<br />
}<br />
else <br />
{<br />
app.Quit();
}<br />
and Outlook closes if I have it open. But I don't know how to for e.g. start Ouutlook, create a mailmessage, fill To, Subject and Body and then send it using “this automation stuff”.
Thanks
_____________________________
...and justice for all
APe
|
|
|
|
|
well, I never actually sent the messages myself, but here's some code I used to get the messages from the user's inbox and populate the listview I have in my dialog box:
void COtestDlg::PopulateLVW()
{
MAPIFolder folderInbox;
Recipients recs;
Recipient rec;
_NameSpace ns;
_Items itemsMessages;
_MailItem mi;
_MailItem mReply;
_Application app;
try
{
if(!app.CreateDispatch("Outlook.Application"))
{
AfxMessageBox("Couldn't start Outlook.");
}
else
{
ns = app.GetNamespace("MAPI");
COleVariant vt;
COleVariant vtOptional("");
COleVariant vtTrue;
vt.ChangeType(VT_BOOL);
vt.boolVal = true;
vt.ChangeType(VT_I2,NULL);
ns.Logon(vtOptional, vtOptional, vtTrue, vtTrue);
folderInbox = ns.GetDefaultFolder(6);
itemsMessages = folderInbox.GetItems();
aMessages = new CMessageItem[itemsMessages.GetCount()];
for (int x = 0; x < itemsMessages.GetCount(); x++)
{
mi = itemsMessages.Item(COleVariant((long) x + 1L));
mReply = mi.Reply();
recs = mReply.GetRecipients();
rec = recs.Item(COleVariant((long) 1L));
CString address = rec.GetAddress();
aMessages[x].m_strBody = mi.GetBody();
aMessages[x].m_strEmailAddress = address;
aMessages[x].m_strEntryID = mi.GetEntryID();
aMessages[x].m_strHTMLBody = mi.GetHTMLBody();
aMessages[x].m_strSubject = mi.GetSubject();
CString strBody = mi.GetBody();
strBody.Replace("\r\n"," ");
strBody = strBody.Left(50);
m_lvwResults.InsertItem(x,address);
m_lvwResults.SetItemText(x,1,mi.GetSubject());
m_lvwResults.SetItemText(x,2,strBody);
m_lvwResults.SetItemData(x,x);
}
CString strCount;
strCount.Format("%d",m_lvwResults.GetItemCount());
m_lblCount.SetWindowText(strCount);
ns.Logoff();
}
}
catch(...)
{
AfxMessageBox("There has been an error.",MB_ICONINFORMATION);
}
}
I hope this helps in any way
If it's broken, I probably did it
bdiamond
|
|
|
|
|
THANKS!! Your code made me think a bit and found out these simple lines to send a message:
_MailItem mail = app.CreateItem( 0 );
mail.SetTo( "blubb@syd.kth.se" );<br />
mail.SetSubject( "Mail from VC++ automation" );<br />
mail.SetBody( "The BODY" );<br />
mail.Send();<br />
but still I'd like to find any MS Outlook C++ Reference somewhere. I googeld but no success.
_____________________________
...and justice for all
APe
|
|
|
|