|
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.
|
|
|
|
|
Thanks Sir,
foe this great help
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi,
Has anybody had any luck using the Microsoft SQLServer ODBC drivers (Driver version: 03.81.9030, ODBC version : 03.52)
to connect to a SQL Server 2000 database and passing in a SELECT with a FOR XML clause. I keep
getting Error [Microsoft][ODBC SQL Server Driver][SQL Server]The FOR XML clause is not allowed in a CURSOR statement
., State: 42000, Error: 6819.
Is there a work around (eg putting the select in a stored procedure) or am I missing something ?
I am using SQLExecDirect() to execute the statement.
Or could any one suggest a better way to retrieve data from a standard table in XML formated string?
Please Help!!
|
|
|
|
|
I have write a exe com server. It can run more than one instance. When my client exe call createinstance, it always connect to the first started one, but i want my client exe to popup a dialog to choose one to connect. Is Any body konw how to it? thanks!
c++ : my dream
|
|
|
|
|
When you do a create instance you specify the CLSID of your server which is unique and hence you are getting connected to the the first instance. Personally I think your EXE being an Out Of Process COM Server should be single instance and support MTA. Please, Correct me if I am wrong.
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Right it is out of process, but it is not single instance. The server is started first and can run serveral instance, which one is for a purpose.
c++ : my dream
|
|
|
|
|
Hello Richard,
I believe that in general, it is not possible to control the actual instance of your COM exe server from which to create your COM object.
This remains the privilege of the COM system. One thing that -is- controllable, however, is whether a new instance of your COM exe server is launched whenever a new instance of your COM object is created. Visual Basic allows for setting this.
I think that at runtime, the COM system refers to some value in the registry to determine whether a new instance of your COM server is to be launched. I really do not know what is the registry key to refer. I'll let you know once I find this out.
Hope the above helps, Richard.
Regards,
Bio.
|
|
|
|
|
I think you're seeing the situation the wrong way.
Your COM server should be Unique but think of it as the entry point for what you really need to be in multiple instances.
For example, see it as getting the handle of an Excel Application object, then you would want your client app to be able to select or create a new Excel Workbook.
So, Basicly, Client App gets a Handle to the COM server primary object which might contain a collection of SomeAppInstance that your client application can present to the user. The user is presented with 3 choices, 1) Select an instance, 2) Create a new instance, 3) Cancel Selection/Connection.
Hope this applies to your needs.
|
|
|
|
|
Hi all,
I'm trying to save a email message using MAPI. I can get to the message I want to save, but I'm not sure on how to save it to my hard drive. I'm using Outlook 2003 on XP Pro.
Thanks in advance.
Ken
|
|
|
|
|
How to get message string for HRESULTs I got from URLDownloadToFile() and other URL Monikers functions?
8 is error
C is FACILITY_INTERNET
5 is some error code.
I need smth like FormatMessage() API.
I tried FormatMessage() from modules "wininet.dll" and "urlmon.dll" (for codes 0x800C0005 and 5) but that does not work:
// hr == 0x800C0005
FormatMessage (FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
GetModuleHandle("wininet.dll"), hr & 0xFFFF, 0, (LPTSTR) &msg, 0, NULL);
InternetGetLastResponse() does not return anything too.
BTW, I found the following explanations is MSDN:
The server or proxy was not found (Error=800C0005)
The protocol is not known and no pluggable protocols have been entered that match. (Error=800C000D)
What are other codes (I experienced 0x800C0007, 0x800C0008)?
|
|
|
|
|
BTW2, using IErrorInfo with GetErrorInfo() COM function does not return any error too.
|
|
|
|
|
Don't know how to translate automatically to strings, but for the URLMon error messages, you can look into the UrlMon.h header (in Platform SDK), where the codes are somehow described
e.g.
0x800C0005L - INET_E_RESOURCE_NOT_FOUND
0x800C0007L - INET_E_DATA_NOT_AVAILABLE
0x800C0008L - INET_E_DOWNLOAD_FAILURE
...
for detailed description you can then search for the descriptive code in MSDN (or google)
|
|
|
|
|
hi to every one hope every one ll b fine and enjoying the real world of
prog
i m looking for any one who can help me regarding to com i want to give
visual
look n feel to my control using ICON .ico the only thing i know about
that is using IPicture interface but how i dont know so help me i m
v.gr8 n pesonaly thankful to u
looking for ur coperation
regards
sommerbwn
sommerbwn
|
|
|
|
|
the IPicture interface and the methods OleLoadPicture are quite good described in the MSDN documentation :P
|
|
|
|