|
To avoid flickering, you should be doing your stuff in OnEraseBkgnd (and not calling CDialog::OnEraseBkgnd from the overriden handler). Are you already doing that?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I tried to do that, but didn't see the handler listed in the class wizard. I'm starting to realise that this doesn't the handler isn't there to overridden.
Thanks
matthew
|
|
|
|
|
That pesky message filter again... Please open the MFC wizard, go to the Class Info tab and select the option "Window" in the Message fitler combobox. Now the message WM_ERASEBKGND should be appearing in the list of overrideable messages.
I wonder why the NS guys decided to put such a thing. It takes ages till one first discovers it (usually on a "nervous breakdown" mood), and moreover it's four tabs away from the list that it modifies!
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello
As the documentation state, printf function print to stdout. The problem is: in my windows application, I open a normal window, and now I ask:
where is in this situation stdin?????
Could I use printf function to write on a window user area?? Is any trick to acomplish this task?.
Thanks
|
|
|
|
|
|
I can use NetUserAdd to create a user and NetLocalGroupAddMembers to assign it to a group. I need to give the name of the group. Therefore, if I specify 'Administrators', it will only work on English systems.
How to do it on any system (Windows 2000), such as French, Italian, Spanish ,...
Thank you for your answers !
P.S. : I do not want to check the system language, and manage all the translations of 'Administrators', 'Guest', ... I want it to work on ANY language
|
|
|
|
|
Hi all,
I know Win2000 proffesional supported Farsi language ...
But i can't see it in Language List in Win2000 !
Can anybody help me ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I found my answer
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
void Investors:: insertionSort(Investor* investorsList, int n)
{
int j, p;
Investor temp;
for(p=1; p<n; p++)
="" {
="" temp="investorsList[p];
" for(j="p;" j=""> 0 && investorsList[j-1] > temp; j--)
investorsList[j] = investorsList[j - 1];
investorsList[j] = temp;
}
}
<\pre>
C:\Windows\Desktop\Project2\Project.cpp(630) : error C2676: binary '>' : 'class Investor' does not define this operator or a conversion to a type acceptable to the predefined operator
Error executing cl.exe.
|
|
|
|
|
First of all, please tick in the "Display this message as-is (no HTML)" checkbox. Your code comes as garbage since '<' characters mess up with HTML.
Your problem lies in the piece of sentence investorsList[j-1] > temp . I guess you're trying to compare Investor s somehow for sorting purposes. For this to work, you have to define the corresponding comparison operator:
bool operator >(const Investor& i1,const Investor& i2)
{
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Hi!
Is there an easy way how an MFC program can retrieve its own location in means of drive and folders? I've been searching thru the whole MSDN Library for a couple of times and got none the wiser. Right now I use GetCommandLine() and search for the first two quotes, as they wrap the program's name and location. But I think this is quite risky, so I'd appreciate your help.
Thanks,
Martin
|
|
|
|
|
GetModuleFileName(NULL) .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
When I am trying to build my project in VC++ 6.0, Windows 95,with some files updated, all of my files in that project are also compiling.(I have tried build selection also). can any one suggest what i have to do for compiling only those
files.
Thanks for reply....
Kishore
Kishore
miel, senate
bangalore
|
|
|
|
|
I think the file creation dates dont match the system date. Maybe you developed them on a system with a futuristic wrong date.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
I have written a function that given an Interface GUID, class name, method name, and parameters; it will execute the method. Now I need to get the return values for byref parameters.
I call invoke as follows
hr = pdisp->Invoke(dispid,IID_NULL,LOCALE_SYSTEM_DEFAULT,DISPATCH_METHOD,&dispparams,pval,&excep,&uArgErr);
Now I want to return the values of dispparams.rgvarg out through a safe array.
Can anyone help??
-------------------------------
STDMETHODIMP CClassWrapper::RunMethod(BSTR strIIDImplemented, BSTR strClassName, BSTR strFunctionName, INT intArgCount, VARIANT * ArgType, VARIANT * ArgVals, VARIANT * ArgValsRet, VARIANT *pval)
{
HRESULT hr = S_OK; // Result code
IID ImplemInteface; // Interface to implement
CLSID clsid; // CLSID of ActiveX object.
LPDISPATCH pdisp = NULL; // IDispatch of ActiveX object.
DISPID dispid; //dispatch id of function
//get the Interface Pointer from Giud passed in
hr = IIDFromString(strIIDImplemented,&ImplemInteface);
if (FAILED(hr))
{
return hr;
}
// Retrieve CLSID from the ProgID that the user specified.
hr = CLSIDFromProgID(strClassName, &clsid);
if (FAILED(hr))
{
return hr;
}
//init com
hr = OleInitialize(NULL);
// create object
hr = CoCreateInstance(clsid, NULL, CLSCTX_SERVER, ImplemInteface, reinterpret_cast<void**>(&pdisp) );
if (FAILED(hr))
{
CoUninitialize();
return hr;
}
//get id for function
hr = pdisp->GetIDsOfNames(IID_NULL,&strFunctionName,1, LOCALE_SYSTEM_DEFAULT,&dispid);
if (FAILED(hr))
{
CoUninitialize();
return hr;
}
SAFEARRAY *sa, *saTypes, *saReturn, *saDisp ;
sa = (*ArgVals->pparray);
saTypes = (*ArgType->pparray);
if(pval) ::VariantClear(pval);
DISPPARAMS dispparams = {NULL,NULL,0,0};
if (intArgCount > 0 )
{
dispparams.cArgs = intArgCount;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = new VARIANTARG[intArgCount];
VARIANT* rgElems, *rgElemsTypes, *rgElemRets;
SafeArrayAccessData(sa, (LPVOID*)&rgElems);
SafeArrayAccessData(saTypes, (LPVOID*)&rgElemsTypes);
for(int i=intArgCount-1;i>=0;i--)
{
switch (rgElemsTypes[i].intVal)
{
case VT_UI1:
dispparams.rgvarg[i].vt = VT_UI1;
dispparams.rgvarg[i].bVal = rgElems[i].bVal;
break;
case VT_I2:
dispparams.rgvarg[i].vt = VT_I2;
dispparams.rgvarg[i].iVal = rgElems[i].iVal;
break;
case VT_I4:
dispparams.rgvarg[i].vt = VT_I4;
dispparams.rgvarg[i].lVal = rgElems[i].lVal;
break;
case VT_R4:
dispparams.rgvarg[i].vt = VT_R4;
dispparams.rgvarg[i].fltVal = rgElems[i].fltVal;
break;
case VT_BOOL:
dispparams.rgvarg[i].vt = VT_BOOL;
dispparams.rgvarg[i].boolVal = rgElems[i].boolVal;
break;
case VT_CY:
dispparams.rgvarg[i].vt = VT_CY;
dispparams.rgvarg[i].cyVal = rgElems[i].cyVal;
break;
case VT_BSTR:
dispparams.rgvarg[i].vt = VT_BSTR;
dispparams.rgvarg[i].bstrVal = rgElems[i].bstrVal;
break;
case VT_UNKNOWN:
dispparams.rgvarg[i].vt = VT_UNKNOWN;
dispparams.rgvarg[i].punkVal = rgElems[i].punkVal;
break;
case VT_DISPATCH:
dispparams.rgvarg[i].vt = VT_DISPATCH;
dispparams.rgvarg[i].pdispVal = rgElems[i].pdispVal;
break;
case VT_ARRAY:
dispparams.rgvarg[i].vt = VT_ARRAY;
dispparams.rgvarg[i].parray = rgElems[i].parray;
break;
case VT_VARIANT:
dispparams.rgvarg[i].vt = VT_VARIANT;
dispparams.rgvarg[i] = rgElems[i];
break;
default:
break;
}
}
SafeArrayUnaccessData(sa);
SafeArrayUnaccessData(saTypes);
EXCEPINFO excep;
UINT uArgErr;
hr = pdisp->Invoke(dispid,IID_NULL,LOCALE_SYSTEM_DEFAULT,DISPATCH_METHOD,&dispparams,pval,&excep,&uArgErr);
}
else
{
EXCEPINFO excep;
UINT uArgErr;
hr = pdisp->Invoke(dispid,IID_NULL,LOCALE_SYSTEM_DEFAULT,DISPATCH_METHOD,&dispparams,pval,&excep,&uArgErr);
}
//release com
CoUninitialize();
return hr;
}
|
|
|
|
|
I think you lost me just a little. dispparams are the parameters you're passing in. The resulting data from calling the function is in pval, not dispparams unless I'm missing something? I can help with a little more detail and a couple examples. While I try to NEVER have to go through this like you are (I love smart pointers) I've certainly had to do it enough times.
Matt
|
|
|
|
|
I just stumbled onto this now...way cool...but under windows 95 you acn actually use interupts...?
This means low level tinkering...how much cooler can you get. However the MSDN states Window95 ONLY
Does this exclude Windows 98...? I don't see how it could...maybe the docs are really old, cuz...who uses INT anymore..?
Interupts in dos allowed crazy programming, do they apply as well in windows...?
How though...When you call INT does it actually switch the processor outta protected mode do it's thing and switch back...? I thought device drivers replaced interupts..
Anybody care to elaborate...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You can use DeviceIoControl to do a lot of stuff that you used to use interupts in DOS for. I am not sure of the details. Some time ago I wrote an app [for Win 95/98/ME] that made INT 13h calls to read/write floppy disk sectors. I can't remember the details. I remember meaning then to write an article for CP but then forgot about it. I remember something about a vxd that worked in 98/85/ME.
For NT/2000 I had to write separate functions using CreateFile and opeing the floppy as a file. But that didnt let me access the 80th [81st one]track and we had to make some changes to the 98/ME/95 version to use the 79th [80th] track.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
So you can actually write to the boot sector of the harddisk...? Thats sweet...i'm totally gonna have to read up that...I've been thinking for sometime now...that like a
Windows Assembler would be super cool...
Just think...click n drag Visual Basic IDE but coding in assembly...I personally think it sounds cool.
I gotta learn mroe about VxD's though...I seen a really interesting book Windows 98 system programming...MSPRESS every read it...?
In any case...i'm pretty hapy even though it'll be sometime before i have time to dick around with those functions.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi.. just wanna ask a simple question..
given the LOGFONT data structure.. how would I know the FONT SIZE of the TEXT displayed..'cuz seems like lfHeight and lfWidth need to be transformed or processed to get the FONT SIZE?
Thanks in advance!!!
|
|
|
|
|
Initialize the structure with a call to GetTextMetrics(ex)
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
The relation between lfHeight and the font's point size is:
lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
How do I programmatically rename a file?
Cd
|
|
|
|
|