|
Sorry, I was confusing the CComboBox/ListBox behavior. The list box worked correctly when initially loaded with strings, either by hand or from the vector. When I tried to refresh the data in the list box, I called the ResetContent method of the list box. It returned values that indicated all the items had been deleted. The I added new items but it then displays two sets of items.
|
|
|
|
|
Very strange. Can you create a new dialog-based application that mimicks this behavior? Trying to scale the problem down to just a few relevant lines of code is sometimes very helpful.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Got it worked out. Weird. I was creating controls at work on an XP machine. Carried it home to my 2000 machine and the controls were all created correctly except that they had zero sizes. Once I went in and "resized" them with the InterfaceBuilder everything was fine.
Thanks
|
|
|
|
|
Dear all,
I writting an application using MFC.
Now I need to access to the View object from the App class.
Could you please tell me how.
Thanks a lot in advance.
-Kien Bui
|
|
|
|
|
In SDI app: ((CFrameWnd*)AfxGetMainWnd())->GetActiveView()
In MDI app: ((CMDIFrameWnd*)AfxGetMainWnd())->GetActiveFrame()->GetActiveView()
Robert-Antonio
"Love without sex is like a fish without antlers"
|
|
|
|
|
Thank you very much!
-Kien Bui
|
|
|
|
|
How to get 'IRowsetFind' interface in oledb sdk !
dear all:
i will use following code in my program(C++) :
discover 'pICommandProperties->SetProperties(1,rgInitPropSet);' return failed code 'DB_S_ERRORSOCCURRED'
so 'pIRowset->QueryInterface(IID_IRowsetFind,(void **)&pIRowsetFind);' return failed!
dear all, please help me! how to get 'IRowsetFind' interface in oledb sdk , and how to use 'IRowsetFind->FindNextRow()'
InitProperties[0].dwPropertyID=DBPROP_IRowsetScroll;
InitProperties[0].dwOptions=DBPROPOPTIONS_REQUIRED;
InitProperties[0].dwStatus=DBPROPSTATUS_OK;
InitProperties[0].colid=DB_NULLID;
InitProperties[0].vValue.vt=VT_BOOL;
InitProperties[0].vValue.lVal=VARIANT_TRUE;
InitProperties[1].dwPropertyID=DBPROP_IRowsetFind;
InitProperties[1].dwOptions=DBPROPOPTIONS_REQUIRED;
InitProperties[1].dwStatus=DBPROPSTATUS_OK;
InitProperties[1].colid=DB_NULLID;
InitProperties[1].vValue.vt=VT_BOOL;
InitProperties[1].vValue.lVal=VARIANT_TRUE;
rgInitPropSet[0].cProperties=2;
rgInitPropSet[0].guidPropertySet=DBPROPSET_ROWSET;
rgInitPropSet[0].rgProperties=InitProperties;
hr=pICommandText->QueryInterface(IID_ICommandProperties,(void **)&pICommandProperties);
hr=pICommandProperties->SetProperties(1,rgInitPropSet);
if (DB_S_ERRORSOCCURRED==pICommandProperties->SetProperties(1,rgInitPropSet))
cout<< "test";
if(FAILED(hr))
{
cout<< "OLEDB Error !\r\nExecute Failed To Set Rowset Properties";
}
hr = pIRowset->QueryInterface(IID_IRowsetFind,(void **)&pIRowsetFind);
if(FAILED(hr))
{
cout << "Failed to get IID_IRowsetFind interface.\n";
cout << endl;
} //end if
Laker
|
|
|
|
|
Hi guys
I'm having troubles with resources in w98 and one of the questions is the following.
I'm using a resource meter to know the GDI resources available, and when I open a CDialog with a lot of controls (>100), the resources go down and when I close it the resources don't raise again until I close the app.
Is this normal? If not, what can be the cause?
I'm using a lot of CLabel controls (derivesd from CStatic controls classes get it here in codeproject)
Best Regards
Doc
|
|
|
|
|
No, it's a memory leak. Some of your controls are creating resources and not cleaning them up. From the sound of it, probably fonts.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Without using MFC how can I tell if the mouse is over my buttons?
I've tried WM_NCHITTEST and WM_MOUSEMOVE along with stuff like ScreenToClient, GetDlgItem, GetDlgCtrlID, ChildWindowFromPoint, ect, but nothing seems to be working.
Any Ideas? Some code would help me out, thanks.
wWw.KruncherInc.cOm - My cool programs
|
|
|
|
|
Just do subclassing for CBUtton
e.g
CYourButton : public CButton
{
.
.
};
and AAdd message Handlers
ON_mouse_Move
regards
Balkrishna Talele
|
|
|
|
|
Can't do that, I'm using pure WIN32 API, no MFC (if I wanted something like MFC I would use VB).
wWw.KruncherInc.cOm - My cool programs
|
|
|
|
|
may i know , what are you using. is it SDK , and if so you might have register the class, in WinProc you will receive all the messages
|
|
|
|
|
You do not need MFC to subclass button controls. You write your button's window procedure and use SetWindowLong() with the GWL_WNDPROC index to subclass the button.
LRESULT CALLBACK MyButtonWindowProc(HWND hWnd, UINT nMsg, WPARAM wp, LPARAM lp)
{
switch (nMsg)
{
case WM_MOUSEMOVE:
default:
return DefWindowProc(hWnd, nMsg, wp, lp);
}
return 0;
}
SetWindowLong(ButtonHwnd, GWL_WNDPROC, (LONG)MyButtonWindowProc);
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
GetCursorPos() returns the current position of the mouse. All you need to do is check if it's within the bounds of your button. You can do this in response to a WM_TIMER , but imho it's better to use TrackMouseEvent() . None of this has any dependency on MFC.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello,
Does anybody know of a way to automate both opening applications and various application calls (possibly .dll files) in Windows 2000 or XP? For example, I am developing a graphics application in C++. There are various repetetive tasks needed in order to prepare many of the application assets. Also, I wanted to use this program for testing purposes or to automate repetitive tasks for various applications I am using in Windows. Possibly record an action script and then I would be able to play the script at any time to perform the recorded task. This could also be applications that I am developing myself.
Are there any libraries that exist that facilitate this in Windows?
Are there any programs already in existence that are able to perform this task?
Thank You.
|
|
|
|
|
are u lookin for winrunner/loadrunner etc...
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
Check this for ideas
http://www.codeproject.com/dll/eventrecorder.asp
you can find similar articles by looking for journal + hook
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Does anyone know where to find an md5 encryptor for executables? I need to encrypt an exe with the message digest algorithm.
-Ryan M.
|
|
|
|
|
Try this library.
Robert-Antonio
"Life is very hard, if you apply E-R model to it."
|
|
|
|
|
Is there a way to tell my VC6 project to execute a script (foo.cmd ) before any files are compiled? I tried adding a custom build step (whose dependency is correctly determined), but the step gets invoked after all the source files are compiled.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Add the foo.cmd file to the project and set custom build step only for this file. Custom build steps for specific files are executed before compilation, but custom build step for whole project is executed after compilation and link.
Robert-Antonio
Love, truth and electric traction must gain victory over hate, lie
and diesel traction.
|
|
|
|
|
Robert-Antonio, the next time you're in Boston, I will buy you as many beers as you desire! Many thanks!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Sounds lovely . What a pity, that Boston is toooo far from Prague...
Robert-Antonio
"I launched Norton Commander and saw, drive C: on the left, drive C: on the right...
Damn, why I need two drives C:??? So I formatted one..."
|
|
|
|
|
Hey, for that kind of offer, the trip seems worth it...
Steve S
|
|
|
|