|
|
Yes,I did. In fact, I did the following:
#include "stdafx.h"
which includes windows.h .
|
|
|
|
|
It took me a day to figure this out:
I am using VC 6.00, and my
stdafx.h looks like this:<br />
<br />
<pre>
#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
</pre><br />
<br />
you need to get rid of <pre>#define WIN32_LEAN_AND_MEAN</pre> to make a simple local COM server work!!<br />
<br />
Thanks!
|
|
|
|
|
Are u using ATL???
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
|
As You are using IClassFactory interafce , give it's declartion too
include unknwn.h
|
|
|
|
|
Hi all,
Apologies if this is a little off-topic for this board, but does anyone know where I can find out the maximum number of rows and columns allowed in an Excel spreadsheet. For once, Goggle isn't being particularly helpful.
TIA,
Pete
|
|
|
|
|
Well, to answer my own question:
http://support.businessobjects.com/library/kbase/articles/c2000454.asp
however, I'd like to get an 'official' description from Microsoft, to satisfy my boss if nothing else...
|
|
|
|
|
Unless they changed in the latest version here are the Maximums.
Rows: 65536
Columns: 256
You can have many sheets, but each sheet cannot contain more than this.
This is annoying when one wants to import a 100,000 lines of invoices coming from an external prog for analysis reasons.
Unfortunately i dont have an official link for you.
Hope this helps.
|
|
|
|
|
if(pMsg) {<br />
LPSPropValue rgMsgprops = NULL;<br />
ULONG cMsgValues = 0;<br />
SizedSPropTagArray(2, rgMsgTags) = {2,{PR_SENDER_NAME,<br />
PR_SUBJECT}};<br />
<br />
hr = pMsg->GetProps((LPSPropTagArray)&rgMsgTags,<br />
MAPI_UNICODE, &cMsgValues, &rgMsgprops);<br />
<br />
IStream *pStream = NULL;<br />
TCHAR tchBody[255] = TEXT("\0");<br />
<br />
hr = pMsg->OpenProperty(PR_BODY, NULL, 0, 0,<br />
(IUnknown **)&pStream);<br />
if(FAILED(hr)) {<br />
pMsg->Release();<br />
pIInboxTable->Release();<br />
pPOPInboxFolder->Release();<br />
return FALSE;<br />
}<br />
<br />
hr = pStream->Read(tchBody, 254, NULL);<br />
pStream->Release();<br />
<br />
TCHAR tchMsg[1024] = TEXT("\0");<br />
wsprintf(tchMsg, TEXT("From: %s\r\nSubject: %s\r\nMsg: %s"), rgMsgprops[0].Value.lpszW,rgMsgprops[1].Value.lpszW, tchBody); <br />
<br />
MAPIFreeBuffer(rgMsgprops);<br />
pMsg->Release();
with this code
after stream the body , hr is S_OK. However, the tchBody is still null string. can anyone help?
thanks
|
|
|
|
|
Hi~
I use IMessage::GetRecipientTable() to get the recipient from the inbox.
However, it return MAPI_E_NO_RECIPIENTS.
Why this happen?
However do a mail of inbox have no recipients?
Thanks
|
|
|
|
|
Hello,
I built a program that reads data from an Excel Workbook and spits out Xml to be read by another program. It is written in C#, and I use Microsoft Visual Studio 2002 for development.
My question is this: where can I find information regarding the use of Microsoft's DLLs. When I compile my program, the following DLL's are placed in my program folder:
Interop.Excel.dll
Interop.Microsoft.Office.Core.dll
Interop.VBIDE.dll
I need to know if I am allowed to include these in my program, because this program is going to be sold and or licenced to people, but I obviously did not write the dll's, and I don't want Microsoft to sue me.
I also need to know what happens if someone has an older or newer version of Excel installed... will these dll's still work?
If someone could at least point me towards the answers to these questions, that would be great. Thanks!
Jeremy O
PM Logic
www.jeremyo.com
|
|
|
|
|
Hi,
I have a windows form(c#) and I am using the mapi dll to read email from a specific account.
my project runs from - C:\Documents and Settings\GJeffrey.LAWACTIVE\My Documents\Visual Studio Projects
but when i try to ininitialize the mapi session i.e. oSession = new MAPI.Session();
in a class named Email and not on my main form it bombs out with this error.
It seems to me that it cannot run this object because this object is in the following directory - C:\Program Files\Common Files\System\Mapi.
If i declare my mapi session as the first thing in my class constructor(or onload of the form) it seems to run fine but then it runs from the second directory.
Any ideas or thought as to how i can solve this or why it is happening??
|
|
|
|
|
Hello,
need to set underline font in word document
<br />
_ApplicationPtr word(L"Word.Application");<br />
word->Visible = true;<br />
word->Activate();<br />
then
<br />
RangePtr myRange = word1->Selection->Font->Underline = WdUnderline.wdUnderlineSingle;<br />
but getting error
error C2228: left of '.wdUnderlineSingle' must have class/struct/union type
Need help
|
|
|
|
|
hi all,
I have a a shell extension dll,in which i have inserted my menu items for a .xyz file( when you right click in explorer),which works fine on Windows 2000, and the context menu is showing my entries.but when the same is installed on Win98 machine, my menu item items are not displayed. or in simple words, my shell extension dll is not loaded in win98.
I had check the registry entries on both machine which appears to be same
and now i am totally clueless about this . Can any expert help me? any starting point to debug this?. I am not using ATL.
Regards
Abhishake
|
|
|
|
|
Hai,
I dont know whether I'm in right place..I'm new to vc++ win32...i am trying to read and write to serial port COM1.
I know we can do this by createfile and read and writefile fns..but i am not sure about the flags and how to set buffer values..and what other funcs i need to do..suppose i want to write say "hello" to com1 and get the acknowledge "hi" from it...can any one help me with the code exactly how to do it..
thanks a lot.
|
|
|
|
|
Hi !
First, you are in the wrong forum. In fact this is not a forum about COM ports but about Component Object Modeling . Try better the C++ forum, you'll have more chance to get a response there.
For your question: the code to use to open the port:
hCom = CreateFile(pszPortName,<br />
GENERIC_READ | GENERIC_WRITE,<br />
0, <br />
NULL, <br />
OPEN_EXISTING, <br />
0, <br />
NULL <br />
);<br />
pszPortName is the name of your port ("COM1","COM2",...)
You can then set some parameters of your port (baudrate, partiy,...):
DCB dcb;<br />
BOOL fSuccess;<br />
DWORD dwError;<br />
<br />
fSuccess = GetCommState(hCom, &dcb);<br />
<br />
if (!fSuccess) <br />
{<br />
dwError=GetLastError();<br />
return dwError;<br />
}<br />
<br />
dcb.BaudRate=9600;<br />
dcb.StopBits=1;<br />
dcb.fParity=1;<br />
dcb.fDtrControl=DTR_CONTROL_DISABLE;<br />
dcb.fRtsControl=RTS_CONTROL_DISABLE;<br />
<br />
fSuccess = SetCommState(hCom, &dcb);
Then use the ReadFile and WriteFile functions...
Hope this helps
|
|
|
|
|
Hi,
I have been writing a C# app with a three tier (Database, business and user level) approach. I would like to do some testing across a network but have no idea on how to expose the business layer on the sever machine so other computers can then use this component across the network.
Can anyone point to an article that will direct me on how to do this?
The machines are XP/2000 machines.
Thanks in advance.
Stephen
|
|
|
|
|
Hi there
I have written an application (nothing to do with the net or html) and want
to add scripting to it. I've done this and it seems to work but only once.
Each time we load a document, an associated vbscript file is also loaded
using ParseScriptText. After ParseScriptText is called I call a script
function from the application to determine if we should infact load a
different data file - indirection based on the script. This
works fine.
Later in processing the data file I call another script function from the
app and it throws an exception with E_UNEXPECTED when calling
GetScriptDispatch. I have checked the script state and it is still connected.
Any ideas what might be wrong?
Thanks
Dave
|
|
|
|
|
Hi All,
I have a Visual Foxpro 6.0 application installed on Windows 2000 server and am trying to run it through Terminal Services Client. It runs ok if I log on to the Terminal Services Server as admin and run the application. The problem comes when I tried to log on as a normal user and run the application. An error message came up as below:
OLE error code 0x80040154: Class not registerd.
I am pretty sure it has something to do with security on the server.
Could somebody please help me to overcome this problem.
Thanks a million
MR.
|
|
|
|
|
I think it's problem with access rights.Check access right of normal user. COM server if not having proper access right, I saw sometimes it thr this kins of error.
|
|
|
|
|
Hi there,
Is there any way to create a simple client/server program in a 16 bit (dos)
project?
I can only use this kind of mode (dos 16 bit) because the microchip i am trying to control remotely connected to the server only supports borland 5.02 DOS 16 BIT projects.
thank you for helping and any suggestions are heart-warmingly welcome!
porac69
|
|
|
|
|
How to create events and notify the user about that event.
Please any body help
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
am new at Com/Atl, In One of my project i have to invoke certain event that can be capture by VB based application normally.
i am coding in Atl dll in Visual C++,any help please!!!
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello Alok,
Your concerns are quite similar to thos of another Code Project member : Akshay (see other messages before this one).
First, make sure that when you define your COM object in ATL, you specify that your object is to support connection points.
Next, you define your event interface (which is an "outgoing" interface, not to be implemented by your COM Object but by your VB client app). Note that because your events are to be captured by a VB app, your event interface must be dual-interfaced (i.e. it must be derived from IDispatch).
Last, you must make your COM Object implement connection point. You can do this by right clicking your COM Object in the object pane and then selecting the "Implement Connection Point" menu item. You will be presented with a list of event interfaces to support (note that you simply support the event interface and you do not write the implementation of the event, this remains the job of your VB client app).
That's three simple steps but alot must go on in between them. Read up David S Platt's "The Essence of COM and ActiveX (A Programmers's Workbook)" for simple tutorials on this.
Best Regards,
Bio.
|
|
|
|