|
HI,
I need to implemnent span tag style(overline etc) in vc++ can anyone help me out... plz thanx....
Helping hands are greater than praying lips
lokesh
|
|
|
|
|
Hi Lokesh,
Not too sure what you are after but here I've done an example that may be what you are looking for:
MSHTML::IHTMLDocument2Ptr spDoc(m_ctlWeb1.GetDocument());
if (spDoc)
{
MSHTML::IHTMLDocument3Ptr spDoc3 = spDoc;
if (spDoc3)
{
MSHTML::IHTMLElementPtr spElem = spDoc3->getElementById(_bstr_t("idSpan1"));
if (spElem)
{
spElem->innerText = _bstr_t("Hello There");
MSHTML::IHTMLStylePtr spElemStyle = spElem->style;
if (spElemStyle)
{
spElemStyle->textDecorationOverline = true;
}
}
}
}
So in the code above we look for an element called 'idSpan1', set the text, and then set the text decoration style to be Overline. Hope this is near the mark.
For further style information go to MSDN and look at the following interfaces:
IHTMLStyle
IHTMLStyle2
IHTMLStyle3
IHTMLStyle4
Hope this helps,
Andy
|
|
|
|
|
Hello everybody,
I am a beginner in com programming, and i have a question:
I have created an ATL 3.0 project including a simple object named MyObj with the attribute of 'appobject' on it's coclass. It has a property named MyString that holds string values. I have successfully built it and then tested it from vb. I have access to MyString property directly without instantiating MyObj. everythings is Ok.
but I have problem with VC. From a Console application which has access to that type library (via import directive) MyString property cannot be accessed without qualification. With the statement:
MyString = "Hello world!";
compiler generates following error:
error C2065: 'MyString' : undeclared identifier
what is the problem? do you think i should use a special syntax?
if so, would you please help me to know how i can use it?
thanks in advance
Roozbeh
|
|
|
|
|
Hi,
Not to sure why you are getting a problem.
Here is an example of how to use it in VC++ (see if it differs to yours)
First, the #import
#import "D:\My Projects\C++\MyObj\MyObj.tlb"
using namespace MyObjLib;
Add the namespace to avoid any conflicts with other COM objects you may use that will have the same name.
Now when using it:
MyObjLib::IMyObjPtr pMyObj = NULL;
try
{
if (SUCCEEDED(pMyObj.CreateInstance(__uuidof(MyObjLib::MyObj))) && pMyObj != NULL)
{
pMyObj->MyString = _T("Hello");
}
}
catch(_com_error &e)
{
}
This ultimately will use the wrapper method PutMyString( _bstr_t pVal ) that is defined in the two new files generated by the #import statement.
These should be in your Debug/Release directories and called MyObj.tlh and MyObj.tli. Ones the header file, the other the implementation file.
Have a look through them to see how your COM object has been wrapped.
Hope this has helped,
Andy
|
|
|
|
|
I'm trying to automate PowerPoint from an MFC application. When I import office TypeLib (from Add MFC Class from Typelib), VS generates these wrappers for the COM calls.
How would one find out what different classes and methods do? Certainly wrappers are not documented in MSDN, and I don't know how to get to the actual COM interfaces being used.
btw I'm using VS.NET 2003 and Office 2003
|
|
|
|
|
You can use the "OLE/COM Object Viewer" accessible
from the Studio .net Tools menu.
open up the tool from the "Tools | OLE/COM Object Viewer" menu
selection and browse to the Microsoft Powerpoint x.xObject Library
in the left hand tree view. the right hand pane should fill up with
registration information. doiuble click in the left hand treeview
on the power point text and it will open the type library definition
(methods, etc..) for the ppt object model.
-
you can also run Powerpoint and select Tools | Macro | Visual Basic Editor
to bring up VBA editor (you must have a presentation open, btw). Then press F2 key to run the object browser
which shows all the methods for the powerpoint library and other
referenced libraries.
--
hope this help..
steve
sas
|
|
|
|
|
and try this link to microsoft's docs...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deovrMicrosoftPowerPoint2000.asp
sas
|
|
|
|
|
Thanks.
I'm gonna try this and see how it goes.
|
|
|
|
|
MS Office actually comes with VB help in the form of .chm files although they are pretty well hidden. The path varies slightly from version to version but if you look around:
C:\Program Files\Microsoft Office\Office10\1033
(the 1033 is the important bit), you should see a bunch of .chm files. These will give you information on the various methods. It's not perfect, but it does help.
There is quite a bit of KB documentation on MSDN, lookup "Office Automation".
|
|
|
|
|
Yeah, I've seen the chm files, but they cover VB only. It is suprising, the lack of MFC samples.
Thanks anyway.
|
|
|
|
|
Hi,
I need to pass an array to a method in a com interface using variants. can anyone help me. i need to do in C++.
|
|
|
|
|
Hi,
Do a search on the sites for SAFEARRAY (or if you're using ATL try CComSafeArray)
Hope this helps,
Andy
|
|
|
|
|
Could someone in simple terms, explain Interface hooking using a COM component like MSN Messenger for example. What are the advantages of using COM interface hooking?
cheers
mike
|
|
|
|
|
|
if i want to implement a firewall with windows apis for
processing each input/output packet please introduce me that apis (if there is)
koosha
|
|
|
|
|
hello everyone. I am in deep sh*t now. i have to develop a biometric authentication system which apply neural network algorithm , that is using handwritten signatures to authenticate users instead of combination of user id and passwords. I do not even know which language to use, some told me MATLAB, some said VB. so can anyone give guidance or sample source code to me so that i do not need to start from scratch since the time is running out.
thanks a lot and please help pass this message around so that i can have more things to refer
|
|
|
|
|
Hi all
I am trying to write an Asynchronous socket in an ocx. I have generated the MFC wizard ocx and created 2 new classes -- connect & listen, both derived from CAsyncSocket.
From the xxxApp.cpp, I have created the Main Socket which listens to accept connects from clients.
I made a call to "WSAAsyncSelect(MainSok,wind->m_hWnd , WM_USER+1,FD_ACCEPT | FD_READ); " also.
But I am unable to capture the events to start reading wot is being written to my socket.
I have also written code in the OnAccept of my MainSocket to accept connections. But this routine is not being called.
How do I now receive data asynchronously???
Please help.
Thanks in advance
Cheers
Raja
|
|
|
|
|
Hello All,
I want to know the code changes to be done for converting STA to MTA on the server side.
Thanks in advance.
|
|
|
|
|
To change your server's COM apartment, change:
CoInitialize(NULL);
to:
::CoInitializeEx(NULL, COINIT_MULTITHREADED);
Bear in mind you will have to use one of the suitable pre-processor declarations (such as _WIN32_DCOM) that will "include" the CoInitializeEx declaration, otherwise you'll get errors that it's an undefined function when you attempt to compile.
|
|
|
|
|
Hi, I have no experience with COM what so ever. I cant find any good articles that actually explain COM from scratch!. If anyone can tell me any sites that are good to start me off.
I use VS.NET, how do i create a new project step by step that uses for example the MSN messenger.exe, using C#??
cheers
|
|
|
|
|
|
Hi,
I'm looking for sample code for shell programming (infotip in particular) but the ones that are in the Shell Programming section of the site do not compile under Visual C++ .NET. Since the .NET 2002 version it seems that several macros have changed and the code generated by the wizards is different.
Would anyone have shell programming samples that do work under Visual C++ .NET 2002 or 2003 ?
fred.
|
|
|
|
|
I have a COM object that I have been using for some time in main applications.
I tried to use it in a dll and I get the error C2787: no GUID has been associated
with this object when I try o compile the code.
Are there any header files that I need to add that are not present in a dll but are included in a main windows application that would fix this problem?
|
|
|
|
|
Some component you're using is trying to use __uuidof to get the GUID for the interface/class, and it hasn't had a GUID associated with it using __declspec( uuid ) . This might be an ATL smart pointer, for example.
If the code is exactly the same, you might be using a different version of the SDK. Check your project's include directory settings.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
in the event you have moved from vc++ 6.0 to vc++ .net studio:
----------------------------------------------------------------
I recently had this problem when going from vc++ 6.o to vc++ .net
I had to move my include directories around (as the other poster suggested); I solved it
by putting the platform sdk inclused before the vc includes.
$(VCInstallDir)PlatformSDK\include
$(VCInstallDir)include
It really has to do with the macros that are defined
in the include files. see MS knowledge base article
"PRB: Error C2787 When Building a Project Using ATL 3.0"
sas
|
|
|
|