|
How to fix (custom ActiveX)control size in design time.
I am using MFC ActiveX ControlWizard.
Please help me.
Thanks
David Park
|
|
|
|
|
How to lock child window from resizing in MDI ?
I am using WTL + MDI/Dialog framework.
- CMDIFrameWindowImpl<MAINFRAME>
--- CMDIChildWindowImpl<MY_FRAME>
----- CDialogImpl<MY_FRAME_VIEW>
i tried to set-up window styles (below) on creating... but child window then freezing :/ and i can do nothing with it (move/minimize)
Style to setup for not-resizing window:
~WS_THICKFRAME;
~WS_MAXIMIZEBOX;
i have example, but it built on Document/View technology...
http://www.thecodeproject.com/dialog/resizeformtofit.asp
----------------------------
never stop coding.
|
|
|
|
|
use the WM_NCCALCSIZE msg to set the dimensions of the dialog to the same min/max size, use it in the frame
regards
|
|
|
|
|
hi
i'm want to use new GNU comipler
the problem is with hash_map interator
after reading some articles i added some extra macros but the didn't solve the problem
compiler seems to do not recognize type
template <typename Data>
or
template <class Data>
and in line
hash_map<int, Data>::interator ptr;
throws an error: expected `;' before "ptr"
here is whole code
<code>
#include <string>
#include <ext/hash_map>
#include <iostream>
#include <iterator>
#if defined(__GNUC__) && (__GNUC__==2) && (__GNUC_MINOR__>=95)
/*STL extensions were put in the std namespace ...*/
namespace gnuext = std ;
#elif defined(__GNUC__) && (__GNUC__>=3)
/* STL extensions have their own namespace */
namespace gnuext = __gnu_cxx ;
#else
#error "This code relies on non-standard STL extensions as defined by GNU libraries."
#endif
#if defined(__GNUC__) && (__GNUC__==2) && (__GNUC_MINOR__>=95)
/*STL extensions were put in the std namespace ...*/
#define __GNUEXT std
#elif defined(__GNUC__) && (__GNUC__>=3)
/* STL extensions have their own namespace */
#define __GNUEXT __gnu_cxx
#else
#error "This code relies on non-standard STL extensions as defined by GNU libraries."
#endif
template <typename Data>
class MyHash {
MyHash() {}
~MyHash() {}
__GNUEXT::hash_map<int,Data> myhash;
void add(Data d)
{
__GNUEXT::hash_map<int, Data>::iterator ptr;
}
};
<code/>
Pain is a weakness living the body
|
|
|
|
|
ravjak wrote:
__GNUEXT::hash_map::iterator ptr;
try:
typename __GNUEXT::hash_map<int, data="">::iterator ptr;
|
|
|
|
|
bingo
thans
Pain is a weakness living the body
|
|
|
|
|
|
Goodmorning!
As the subject line suggests I am having a hard time with the persistance of
my ATL ActiveX control's Font Stock Property and the selection being
remembered once its made. I thought I was doing it all wrong but then to
make sure I had the code right, I made a brand new project with a brande new
control that had the Font stock property as a feature from the very
beginning. I also told the wizard to add the background colour property for
testing sake.
So i compile it and then try to use it in another project....I insert it
into the dialog and then right click to get the properties. I can select the
background colour, and the setting remains. I click on the font property, the
font window comes up with the collection of fonts..i make the selection...hit
OK/apply but the font field in the properties shows up as empty...it does not
actually remember the font I chose.
Like I said, I thought i might be doing something wrong and therefore tried
it out on a brand new control where the font property was added by Visual
Studio's wizard. Is this a little "bug"? and if so...how does one
exterminate/wack it.
Thanks!
Aristotel
|
|
|
|
|
Click me.[^]
We learned how to make Stock Font Propeties work here.
From get_hFont to Load and Save m_pFont.
|
|
|
|
|
hi!
I want to capture the right mouse button event on MS Word document.
is it possible? if so then please help me.
Thanks
Ahmad Jalil Qarshi
|
|
|
|
|
hi!
I have Added a new CommandBarControl of type msoControlButton in the Menu "Inline Picture" (which is displayed when you right click on some picture or some OleObject in MS Word Document). I have also run some VBA macros on click event at this new inserted menu Item by specifying them into PutOnAction function. But now i want to call some functions of my ActiveX control's class when the user right click on my control and then select the newly inserted menu item. Is it possible if so then please help me.
Thanks
Ahmad Jalil Qarshi
|
|
|
|
|
// call member function printWithPrefix() for each element
// - "person: " is passed as an argument to the member function
for_each (coll.begin(), coll.end(),
bind2nd((mem_fun_ref(&Person::printWithPrefix)),
"person: "));
this code from a book, dont compile on vc++.
I am disapointed.
Please. What to do ?
Vincent
|
|
|
|
|
I'm guessing that you're using Visual C++ 6.0. This version doesn't support a lot of the Standard C++ Library.
I recommend that you either use a later version of Visual Studio or download the Visual C++ Toolkit 2003[^], which includes the compiler tools from VS.NET 2003.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I had the same and searched the error without success.
Recently I got VC7.1, I tried it again and it compiled perfectly!
So change your compiler or dont't use mem_fun_ref.
Christof
|
|
|
|
|
Hello...
I have been trying to add a font stock property to my ATL ActiveX control in VS.NET. I go by the examples and documentation at MSDN but its not quite possible. They suggest to right click on the interface of my class under the class view, and select ADD->Properties....
Then apparrently there will be a drop down menu where I will be able to choose the type of stock property, in this case FONT. But no..there is no such drop down menu...only a text fields.. I tried to manually type in Font, but nothing... I tried to manually copy and paste the code shown in the example in the corresponding sections of the project but it won't even compile. How on earth does one add a FOnt stock property to an ATL ActiveX control in VS.NET?
Thanks!
|
|
|
|
|
So it turnes out the only way to achive the above is to manualy create a new project where you state the stock properties from the vary begining, and then copy the code segments over to your existing project code.... tsk tsk tsk
And now the latest problem for the past 2 hours has been that I have added the font stock property and a member variable
CComPtr<ifontdisp> m_pFont; which gets set at OnFontChanged().
Now in my OnDraw() function I would like to select this font and use it,
however I cannot simply do pdc.SelectObject(m_pFont) as m_pFont is not a
CFont. In the MFC only version of ActiveX I could call SelectStockFont(pDC);
but this is no longer suitable in ATL ActiveX.
I cannot figure out how to convert a font refered to by IFontDisp to a CFont
so that I can select it for the drawing code. Could somebody point me in the
right direction please?
Thanks
|
|
|
|
|
greekgoddj wrote:
Could somebody point me in the
right direction please?
QueryInterface() for IFont , which has neat method called get_hFont() . If the object doesn't implement IFont , then you will have to create the font manually, using the properties exposed by IFontDisp (it sucks, I know!)
--
My name in Katakana is ヨルゲン.
My name in German is Jörgen.
My name in Mandarin/Kanji is 乔尔根 西格瓦德森.
My name in Korean is 요르겐.
I blog too now[^]
|
|
|
|
|
Got it! thanks
|
|
|
|
|
hi!
i have made a control for MS Word. Now when i insert the Control into the Word. InitNew methods is called, and when i save the document Save method of IPersistXXX is called but when i open my document the Load method of IPersistXXX is not called.
Furthermore, on reopening the document when i double click my control it displays the following message.
"This object was created in Properties.
This application is not availabe to open this object.
Make sure the application is properly installed and that it has not been deleted, moved, or renamed."
Please help me.
Thanks in advance.
Ahamd Jalil qarshi
|
|
|
|
|
Sir,
I have created an ATL composite control, and am putting it on multiple instances of a modeless dialog box. For each instance of the control I am calling its draw function with different parameters but the multiple instances all display with the same parameters. What is happening and how do I get around this problem.
Esteemed members please help.
Thanks
Deekonda Ramesh
|
|
|
|
|
I want to use ActiveX developed using vc++ in a windows service. Please help me.
|
|
|
|
|
|
hi!
I want to insert an object into MS Word using function AddOleObject. i did it using visual basic 6 using the following function.
InlineShape.AddOleObject(insRange,"{7A4960FC-645E-4971-B2C4-E4C3DB896D10}","",False,False);
where insRange is of Range type. it worked fine. but the problem is that i want to do it in Visual C++6. Now the function prototype in VC++6 is hereunder
MSWord::InlineShapes::AddOLEObject ( VARIANT * ClassType, VARIANT * FileName, VARIANT * LinkToFile, VARIANT * DisplayAsIcon, VARIANT * IconFileName, VARIANT * IconIndex, VARIANT * IconLabel, VARIANT * Range )
i am a bit confused about how to use this function in VC. I tried it using following code.
VARIANT varClassType; VariantInit(&varClassType);
VARIANT varLinkToFile; VariantInit(&varLinkToFile);
VARIANT varDisplayAsIcon; VariantInit(&varDisplayAsIcon);
VARIANT varEmpty; VariantInit(&varEmpty);
VARIANT range; VariantInit(&range);
varClassType.vt = VT_BSTR;
varLinkToFile.vt = VT_BOOL;
varDisplayAsIcon.vt = VT_BOOL;
range.vt = VT_I4;
_bstr_t clsID = "{7A4960FC-645E-4971-B2C4-E4C3DB896D10}";
varClassType.bstrVal = clsID.copy();
varLinkToFile.boolVal = FALSE;
varDisplayAsIcon.boolVal = FALSE;
varEmpty.vt = VT_EMPTY;
range.lVal = 0;
MSWord::InlineShapePtr SigObj = m_pWordApp->ActiveDocument->InlineShapes->AddOLEObject(&varClassType, &varEmpty, &varLinkToFile,&varDisplayAsIcon,&varEmpty, &varEmpty,&varEmpty,&range);
but unfortunately when last line of above code executes my program crashes. i think that the problem is with my first and last parameter in the AddOleObject function. I dont know how to resolve it.
Please help me.
Thanks
|
|
|
|
|
Try using CComVariant instead of VARIANT...
Ex
CComVariant varClassType(clsID);
|
|
|
|
|
Thanks dear you solved my problem. but i m really surprised that what's wrong with VARIANT. according to MSDN CComVariant is a wrapper over VARIANT. then?
But i have solved my problem with your help.
May God Bless You.
Thanks again.
Ahmad jalil Qarshi
|
|
|
|