|
I test it again ,and I found that The ocx control can not display in design mode
of word but do in normal mode. It's the practical case.
Could anybody help me to make the ocx control display the UI in design mode of
word also ! Thanks.
|
|
|
|
|
Please help me.I have problum that when i change the asp pages are shown on top left cornor.i want the asp pages are shows same on different resulotion.
ayaz ullah
|
|
|
|
|
Hello !
you might have specified the length/width of the objects(like tables) in pixles. To look you page same on different resolution, specify the object scales in percentage (%).
-Malli...!
|
|
|
|
|
Following things I done so that I stop getting errors.
1) Copied WTL folder at various places
2) Copied WTL files in VC98, and many combinations.
3) I installed WTL wizard
4) Tools --> options I included, directories ,libraries etc
It gives errors in bunch for CString ,IXMLDOMDocument and upto 103 same.
if any one know how to link WTL.
Compiling...
MainTool.cpp
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2039: 'CString' : is not a member of 'WTL'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2146: syntax error : missing ';' before identifier 'GetXML'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2501: 'CString' : missing storage-class or type specifiers
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : error C2065: 'IXMLDOMDocument' : undeclared identifier
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : error C2955: 'CComPtr' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see declaration of 'CComPtr'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : fatal error C1903: unable to recover from previous error(s); stopping compilation
NatureOfMind.cpp
d:\shiv\w32\atlcom\natureofmind\xmldom.h(49) : error C2143: syntax error : missing ',' before '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(49) : error C2059: syntax error : '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(61) : error C2143: syntax error : missing ',' before '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(61) : error C2059: syntax error : '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2039: 'CString' : is not a member of 'WTL'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2146: syntax error : missing ';' before identifier 'GetXML'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2501: 'CString' : missing storage-class or type specifiers
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : error C2065: 'IXMLDOMDocument' : undeclared identifier
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : error C2955: 'CComPtr' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see declaration of 'CComPtr'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : fatal error C1903: unable to recover from previous error(s); stopping compilation
ReflectionWnd.cpp
d:\shiv\w32\atlcom\natureofmind\xmldom.h(49) : error C2143: syntax error : missing ',' before '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(49) : error C2059: syntax error : '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(61) : error C2143: syntax error : missing ',' before '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(61) : error C2059: syntax error : '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2039: 'CString' : is not a member of 'WTL'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2146: syntax error : missing ';' before identifier 'GetXML'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2501: 'CString' : missing storage-class or type specifiers
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : error C2065: 'IXMLDOMDocument' : undeclared identifier
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : error C2955: 'CComPtr' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see declaration of 'CComPtr'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Supl.cpp
d:\shiv\w32\atlcom\natureofmind\xmldom.h(49) : error C2143: syntax error : missing ',' before '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(49) : error C2059: syntax error : '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(61) : error C2143: syntax error : missing ',' before '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(61) : error C2059: syntax error : '&'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2039: 'CString' : is not a member of 'WTL'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2146: syntax error : missing ';' before identifier 'GetXML'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(64) : error C2501: 'CString' : missing storage-class or type specifiers
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : error C2065: 'IXMLDOMDocument' : undeclared identifier
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : error C2955: 'CComPtr' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see declaration of 'CComPtr'
d:\shiv\w32\atlcom\natureofmind\xmldom.h(88) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Surrender.cpp
d:\shiv\w32\atlcom\natureofmind\xmldom.h(49) : error C2143: syntax error : missing ',' before '&'
|| ART OF LIVING ||
|
|
|
|
|
What version of Visual Studio are you using?
Have you tried building a new test application?
You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!"
Only kings, presidents, editors, and people with tapeworms have the right to use the editorial "we."
|
|
|
|
|
Are you including atlmisc.h? That's where CString is defined. You typically include this in stdafx.h.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I am using VC++ 6.0 and have included atlmisc.h
|| ART OF LIVING ||
|
|
|
|
|
This problem is yet not solved ?
|| ART OF LIVING ||
|
|
|
|
|
Patience is a virtue; do you think we have nothing better to do than answer questions all day?
Before you include any WTL headers, try
#define _WTL_USE_CSTRING
This tells WTL to define and use it's own CString implementation, instead of relying on the MFC one. If you have VC7 or later (which you apparently don't), CString doesn't really need the rest of MFC.
Steve S
Developer for hire
|
|
|
|
|
Dear Friend
Did you noticed problem is not with only CString. It is giving problem with
d:\mrutyunjaya\xmlload\xmldom.h(82) : error C2065: 'IXMLDOMDocument' : undeclared identifier
d:\mrutyunjaya\xmlload\xmldom.h(82) : error C2955: 'CComPtr' : use of class template requires template argument list
c:\program files\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see declaration of 'CComPtr'.
Thanks for CString suggestion I will try that.
We have came in world only for doing human service , that is only joy on this earth which dont have tail of sorrow.
|
|
|
|
|
Well, the file producing the errors isn't a standard one, but my guess is that you're not including an MS supplied file, like msxml.h or something, since that would define IXMLDOMDocument. In any case, this latter issue is nothing to do with WTL.
Steve S
Developer for hire
|
|
|
|
|
#include <msxml2.h> ?
--
Made From Meat By-Products
|
|
|
|
|
I have a recurive loop where each element has to get its parent and retrieve the property
CComPTR<ihtmlelement> spElem=....
.........
........
.......
IHTMLElement* spParentElem=NULL;
while (1)
{
CComBSTR bsTagName;
spElem->get_tagName(&bsTagName);
std::string thisods=ODSTag;
ODSTag=OLE2A(bsTagName);
if(thisods.size() > 0)
{
ODSTag+= ".";
ODSTag+=thisods.c_str();
}
hr = spElem->get_parentElement(&spParentElem);===>memory leaks here
if (FAILED(hr) || !spParentElem)
break;
spElem.Detach()->Release();
spElem=NULL;
spElem = spParentElem;
}
I am getting massive memory leaks in the line above.What am i doing wrong here?Any help or advise would be appreciated.Thanks in advance.
|
|
|
|
|
Firstly if you use the "sp" prefix, which generally stands for "Smart Pointer", the variable in question should actually be a smart pointer. i.e.
CComPtr<IHTMLElement> spParentElem;
Don't write misleading code.
Make your code like this:
CComPtr<IHTMLElement> spParentElem;
while (1)
{
CComBSTR bsTagName;
spElem->get_tagName(&bsTagName);
std::string thisods=ODSTag;
ODSTag=OLE2A(bsTagName);
if(thisods.size() > 0)
{
ODSTag+= ".";
ODSTag+=thisods.c_str();
}
spParentElem.Release();
hr = spElem->get_parentElement(&spParentElem);===>memory leaks here
if (FAILED(hr) || !spParentElem)
{
break;
}
spElem.Detach()->Release();
spElem=NULL;
spElem = spParentElem;
}
The addition is shown in bold.
I'm going to finish with a bitch. We can't see any "<"s or ">"s or what's between them: this is important in C++ code. Also there is no formatting. Please make an effort to make things easier for the people who are taking time to help you. At the very least you could tick the "Ignore HTML tags in this message (good for code snippets)" check box.
Steve
PS: I can see iteration here but no recursion.
|
|
|
|
|
Very well written answer indeed i like your style
You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!"
Only kings, presidents, editors, and people with tapeworms have the right to use the editorial "we."
|
|
|
|
|
|
I have an SDI application. This SDI application has a Splitter control, which has Pane controls and the pane controls themselves have other child controls. So, there is a hierarchy of controls. Now, If I have the handle of any child control, I want to get the Handle of the SDI application window. Is there any way to achieve this?
GetParent() may work, but I would certainly not know how many GetParent()s I am supposed to call. For Example, if I have the HWND of the PaneControl, I would have to call GetParent() twice. One for the Splitter control and the other for the application Window. Similarly, if I have the handle of the Splitter control, I would have to call GetParent() only once. This is the why I think GetParent() is not such a good idea. Any other options?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
<marquee behavior="alternate" scrollamount="5" scrolldelay="50">
|
|
|
|
|
I think AfxGetMainWnd will do.
--
======
Arman
|
|
|
|
|
Is there an AfxGetMainWnd in ATL/WTL?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
<marquee behavior="alternate" scrollamount="5" scrolldelay="50">
|
|
|
|
|
Is there an AfxGetMainWnd in ATL/WTL?
Ah sorry, not sure. I though of MFC forum, sorry again.
--
======
Arman
|
|
|
|
|
Imagine.. in the ATL implementation, we have a collection or an array, ie :
<br />
int num[5];<br />
num[0]=100;..... [5]=500;<br />
Now in my client, (i.e VB) , I need to access them like,
(Imagine collection is the property which points to the array I've mentioned above}
<br />
msgbox (MyComp.Collection[0])<br />
(and like this too..)<br />
MyComp.Collection(0).length --> this should pop "3"<br />
It should popup 100.
-- modified at 11:24 Monday 10th July, 2006
|
|
|
|
|
Try using a SafeArray on the ATL side.
|
|
|
|
|
Hi, you have variuos options in this case, you can try and use some kind of collection enumeration based on the variant safearrays to try to please com clients like VB, or you can use the raw and simply way of having a property that inputs an index and returns the value in the array.
Something like:
idl:
HRESULT get_CollectionItemName([in]long Index,[out,retval]BSTR* pVal);
ClassName.cpp
STDMETHODIMP ClassName::get_CollectionItemName(long Index,BSTR* pVal)
{
lookup vector or container using index
copy item or item member on return value *pVal
return S_OK;
}
This method is fairly simple of implement, you don't need to get very involved in com specific code, and you can use simple datatypes and the kind of array of your choice.
|
|
|
|
|
I was very well able to create toolbar and buttons on it .
but how to use TBSTYLE_DROPDOWN and create the DropDown Button.
SendMessage(m_hWnd, TB_BUTTONSTRUCTSIZE, (2 * sizeof(TBBUTTON)), 0);
SendMessage(m_hWnd, TB_SETMAXTEXTROWS, 1, 0L);// Decides size of button (length)
HICON mh1 = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_ICON1));
HICON mh2 = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_ICON2));
m_hImageList = ImageList_Create(16,16, ILC_COLOR16, 1, 0);
int iI1 = ImageList_AddIcon(m_hImageList, mh1); //NO USE OF iI1
int iI2 = ImageList_AddIcon(m_hImageList, mh2);
// Set the toolbar's image
::SendMessage(m_hWnd, TB_SETIMAGELIST,0, (LPARAM)m_hImageList);
TBBUTTON Button1;
ZeroMemory((void*)&Button1, sizeof(TBBUTTON));
Button1.idCommand = IDM_GETQUOTE1;
Button1.fsState = TBSTATE_ENABLED;
Button1.dwData = 0;
Button1.iBitmap = MAKELONG(0, 0);
::SendMessage(m_hWnd, TB_INSERTBUTTON,0, (LPARAM)&Button1);
TBBUTTON Button2;
ZeroMemory((void*)&Button2, sizeof(TBBUTTON));
Button2.idCommand = IDM_GETQUOTE2;
Button2.fsState = TBSTATE_ENABLED;
Button2.dwData = 0;
Button2.iBitmap = MAKELONG(1, 0);
::SendMessage(m_hWnd, TB_INSERTBUTTON, 0, (LPARAM)&Button2);
We can write Buttonxyz.fsStyle |= TBSTYLE_DROPDOWN;
but how to add extra buttons.
|| ART OF LIVING ||
|
|
|
|
|
I want to know, What Design Pattern does ATL/COM is based upon, I dont want what ATL/COM support, What I need is ON WHAT DESIGN ATL/COM is build upon???
regards
Balkrishna Talele
|
|
|
|
|