|
Hi,
I made an atl server and added few interfaces, accidently my friend added an interface which is MTA, now i know MTA will fail in this design. Hence i want to convert it to STA. Is there any way to convert the existing interface from MTA to STA with minimum effort?
Thank you very much.
Prakash.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
I assume you're talking about an implementation here, not interfaces. Interfaces are just a collection of methods.
In the inheritance list of the C++ class implementing the interface, change any occurence of CComMultiThreadModel to CComSingleThreadModel . In the RGS file, change the ThreadingModel value to Apartment .
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
Actual sign at the laundromat I go to: "No tinting or dying."
|
|
|
|
|
Yeah i was talking about the implementation of the interface and not the interface itself...
Thanx.
and wish you a happy new year.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
can anyone helpme how to pass query values dynamically.
(e.g)
cin>>a;
cin>>b;
char szStr1[100]="Insert into region(regionId,RegionDescription)Values(????,????)"
In what format I should supply the values (i.e) the values of a,b.(plz rewrite the
above statement)
|
|
|
|
|
you can put construct the query this way..
<br />
cin>>a;<br />
cin>>b;<br />
char szStr1[100];<br />
sprintf(szStr1,"Insert into region(regionId,RegionDescription)Values(%d,%d)",a,b);<br />
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
#include <sstream>
int a,b;
std::ostringstream strm;
std::string s;
strm << "Insert into region(regionID, RegionDescription)Values(" << a
<< "," << b << ")" << std::ends;
s = strm.str();
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Hi guys,I have a question
I used Access2000 to build a database,there is a Field named “Price”,it's type is money.
In VC++ ,I used ADO to access this database.
I wanna display the value of this field in my listctrl,the code as follow:
_variant_t Holder;<br />
CString str;<br />
<br />
Holder = theApp.m_pADOSet->GetCollect("Price");<br />
<br />
if ( VT_NULL==Holder.vt ) str="N/A";<br />
<br />
else str.Format("%.2f", Holder.dblVal);<br />
<br />
m_ListCtrl.SetItemText(i, 7, str);<br />
listctrl display 0.00 in this field.but in my table,it's value is 3.00,could anyone tell me what I can do? thanks
===============
YES, I am here.
===============
|
|
|
|
|
|
sometime soon look for an antialiasing article... as i've just played around with it and gotten it to work pretty well for straight lines and the concept should work for any shapes
r -€
|
|
|
|
|
Does anyone know if there is a way to reset the colour of a menu bar to the same as the background of a dialog? To set dialog background colour, one uses SetDialogBkColor(). With a menu in the dialog, one gets an ugly grey stripe across the top. OK! I know I'm sick and demented and should be using CFrameWnd, but I LIKE dialogs!! And, for a newcomer, they're a damn sight easier to use!! You would be making 2004 start pleasantly for me!!!
Happy New Year
The fool who knows that he is a fool is truly wise.
The fool who thinks that he is wise is truly a fool.
Dhamapadda - Sayings of the Buddha (slightly modified!)
Brian
|
|
|
|
|
Hello all.
I am trying to change the text/style of my button(s). Instead of the default, I want to make them Tahoma, 14pt. The code that I am using to do this is listed below. What is happening is this: If I put this code in the OnInitDialog() or OnPaint(), it somewhat works. The button will look different than the other ones, but now how I am specifying it to look. No matter what nHeight size that I use, it initializes to this same size every time, and bold. But, the funny thing is that the same exact code when used inside an OnBnClickedButton1() changes the font for that button text to exactly what I want. I am wondering why this same code is not working properly in the OnInitDialog() / OnPaint() ??
Also: I am wondering if there is a way to set the default font for the dialog buttons or set the font / size for the button text with the resource editor (instead of having to have code to "change" the font of the button) ?
Thanks
CFont ListBoxFont;
ListBoxFont.CreateFont(
14, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Tahoma"); // lpszFacename
m_button1.SetFont(&ListBoxFont,TRUE);
|
|
|
|
|
try making new CFont object using CFont* ListBoxFont = new CFont;
that might work... just an idea
r -€
|
|
|
|
|
Your CFont object needs to be moved to the header file of your dialog class.
What's happening is that the CFont object is being created on the stack within your function and when the function exits the CFont object goes out of scope and it's destructor is being called.
shultas wrote:
Also: I am wondering if there is a way to set the default font for the dialog buttons or set the font / size for the button text with the resource editor (instead of having to have code to "change" the font of the button) ?
This would be a nice feature. Microsoft, are you listening?
Kelly Herald
Software Developer
MPC
|
|
|
|
|
LOGFONT logFont;
logFont.lfHeight = 12;
logFont.lfWidth = 0;
logFont.lfWeight = FW_BOLD;
logFont.lfItalic = FALSE;
logFont.lfUnderline = FALSE;
logFont.lfStrikeOut = FALSE;
logFont.lfEscapement = 0;
logFont.lfOrientation = 0;
lstrcpy(logFont.lfFaceName, _T("Arial"));
m_font.CreateFontIndirect(&logFont); // Create the font.
GetDlgItem(IDC_BUTTON)->SetFont(&m_font);
Declare CFont in .h file
|
|
|
|
|
When I put the declaration of Cfont on the .h file, it whined saying that multiple definitions were found (probably because that .h file is included in several places). (I did not put it in the class declaration, but after the class declaration).
But, what I did is right up top in my .c file where the <include> statements were, I put Cfont ListBoxFont; in there and it worked perfectly
Thanks for the tips!
|
|
|
|
|
shultas wrote:
When I put the declaration of Cfont on the .h file, it whined saying that multiple definitions were found (probably because that .h file is included in several places). (I did not put it in the class declaration, but after the class declaration).
Try to put the CFont declaration in the class scope, as a class member.
shultas wrote:
But, what I did is right up top in my .c file where the statements were, I put Cfont ListBoxFont; in there and it worked perfectly
That has essentially the same effect I believe. Since here it's been declared as a global variable, the CFont still exists after exiting OnInitDialog()
|
|
|
|
|
Is there a way to intercept mouse clicks when the current window is minimized or inactive?
Thanks
~Mike
|
|
|
|
|
When ou click on a window, it will become active and you'll recieve your mouse messages.
when you window is minimized, you want to capture mouse clicks inside another window?
Probably best to look into hooks
HTH
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Yes, actually I want to intercept every mouse click once the "Start" button of my program is clicked... can you help me?
|
|
|
|
|
Hello everyone,
I have been working on an MFC SDI program whose Document actually has lists of lists (and possibly a list of a list of a list). I would like to get into a good habit and be consistent with the way I maintain collections (mostly lists, occasionally arrays and maps). Almost all my objects are derived from CObject (for serializing, etc.).
I guess it comes down to picking between CList<type, type>, CList<type, type&>, CList<type*, type*> and whatever other combinations. To keep sane, I think I always want to use CList<type*, type*>. That way, I just use the new operator at the point where an object needs to be instantiated and call delete on it (while traversing the list or sublist) at the 'outer' list's destructor.
I would like comments about this. Is it safe? Is it a decent practice to keep? How can I prevent double deleting the same objects (if that could even happen)? Does this choice affect how I code the required copy constructor and assignment operator (which always seem to involve references)?
Thanks in advance for any advice and comments!
Happy New Year,
Eric
|
|
|
|
|
Is this the proper forum to ask this question, or should I move it elsewhere?
Thanks,
Eric
|
|
|
|
|
Using NMAKE (the VC++6 version) and a makefile, I can easily write implcit rules to compile *.c *.cpp and *.asm files.
However, if I write an implicit rule to compile an *.a39 file, I always get an error;
NMAKE : fatal error U1073: don't know how to make 'D:\v400\bld\obj\testprg.o'
It seems that if it is not a "normal" filetype then NMAKE will not find it.
Is there any way around this (apart from renaming my files)?
Thanks,
Bryan.
|
|
|
|
|
Hi
When closing access database file objects in c++ I keep getting this error:- Debug Assertion Failed.
It happens as I close the CDaoDatabase object but I have noticed that when it is debugged and stepped over there are no errors.
Why doesn't this work?
CDaoDatabase db;<br />
db.Open( _T("c:\\database.mdb") );<br />
db.Close();
Also are there any good examples of using the MS Jet Engine including V4 if pos.
Many thanks
Jason
|
|
|
|
|
Hello,
I think this article helps to you.
http://funducode.com/freevc/database/database2.htm
With Regards,
R.Selvam
|
|
|
|
|
Hi,
How can we compare sign of numbers in C++ ?
Bye,
Claude
|
|
|
|