|
A pointer to a member function is not interchangeable with a pointer to a global function, because the former also has a this pointer. You can see it in the code, void(*)(int) versus void(A::*)(int)
One way to fix it is to have TestB() declared as void TestB( void(A::*ptr) ( int )) although without knowing what your whole app is like I don't know if this the best way.
--Mike--
Latest blog entry: *drool* (Alyson) [May 10]
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
How can we enter an integer data in a database?
My database is SQL
When I try to do this I see an error
rose:
|
|
|
|
|
Hello,
how can I load a gif file into the display
device context? I don't want to use a resource.
Thanks
|
|
|
|
|
How about GDI+?
Regards,
BB
|
|
|
|
|
LoadImage(AfxGetInstanceHandle( ),
strFileName,
IMAGE_BITMAP,
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON),
LR_LOADFROMFILE);
Swimming in a fish bowl
|
|
|
|
|
Hi all code gurus,
I'm trying to get all the windows that have a task bar button, I use EnumWindows() to enumerate thourgh all the windows but cannot figure out whether a given window has a task bar button. Any ideas how to accomplish this?
Regards
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|
|
Use GetWindowLongPtr API function with GWL_EXSTYLE to retrieve the extended window style for each window, then check for the WS_EX_APPWINDOW bit in this value. If it's set, then the window is visible in the taskbar.
|
|
|
|
|
|
Well, actually that didn't work, when I do this I get only a few windows, I assume it only returns windows of applications with only one running instance, when there are multiple instances on an applicaion no windows for that application are returned .. thanks anyway
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|
|
I don't think I exactly did catch what you mean with "windows with a taskbar button" but did you try the Spy++ utility? Just run spy++ and right click/properties on any window, there you can see which styles it has, what parent window it belongs to and lots of other stuff which I think could be helpful to further investigate your problem and maybe find a general solution for those windows you want to differentiate from the others. Hope this helps..
|
|
|
|
|
What is the easiest way to convert a CString to WSTR in MFC under non unicode builds?
John
|
|
|
|
|
Answering my own question.
<br />
USES_CONVERSION;<br />
<br />
serverInfo.pwszName = T2W((LPTSTR)(LPCSTR)strServer);
|
|
|
|
|
|
Mike Thanks. I checked out the link before I asked the question but did not directly find the answer there. Maybe I did not look hard enough there are a lot of examples in the article.
John
|
|
|
|
|
Actually,
T2CW(strServer)
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I am working on a system were I need to display text in a rect at the best possible resolution. I am passed the a CDC, font name, color, and a CRect.
Here is my current approach (which I am not happy with). The rect is passed in logical coords (HIEnglish), so I convert it to device coords with LPtoDP. I fill in the LOGFONT struct with the lf.lfHeight = -rect.Height(). then select the font into the CDC and use the DrawText function with the DT_CALCRECT option to see how big the text will be. If it does not fit, I loop thru this procedure making the font smaller until it fits in the original rect.
Does anybody have a better idea? Thanks in advance.
Craig
|
|
|
|
|
cdsmith wrote:
Does anybody have a better idea?
Well I don't. If you are concerned about performance then maybe halving the font size each time until it fits, then working up untill it doesn't may be faster. I can think of some other optimizations as well, but you haven't said that performance is an issue, so I assume it isn't.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Do you try scaling the width accordingly to the results?
Example:
Desired width = 100
1. pass: Font width = 17 and you've got 135 pixels wide output.
2. pass: Font width = 100*17/135 ~= 12 and you should get roughly 100 pixels.
Sure it won't give exact results (because of all the kerning and precision bloat) but I think it's a better approach.
|
|
|
|
|
I have a 24-bit color bitmap
>> I want it to be bleared about 50%
Could you give me a solution
thanks
|
|
|
|
|
Does anyone know of a way to make the framework display an icon in the typical top left location without the WS_SYSMENU style? I'd also like to have tha ability to change the icon with SetIcon() and let MFC worry about the placement and drawing... but I'd don't want the close button visible, and would like to make the system menu inaccessable as well. Drawing manually isn't too hard in general, but in that Top Left location it would involve moving the caption, right?
Thanks a lot.
|
|
|
|
|
Can anyone tell me how to call an Oracle stored proc from MFC using ODBC.
I have used a derived class from CRecordset.
My default SQL is:
<br />
CString CSal2Uni_GetPlans::GetDefaultSQL()<br />
{<br />
return _T("{CALL SAL2UNI_GETPLANS}");<br />
}<br />
sp_Plans is a CRecordset derived class that will call the stored proc.
sp_Plans.Open(CRecordset::forwardOnly, sp_Plans.GetDefaultSQL(), CRecordset::executeDirect);
This does not seem to work. Do you have any idea why? The stored proc itself is:
<br />
CREATE OR REPLACE PROCEDURE UNICORN.SAL2UNI_GETPLANS<br />
IS<br />
CURSOR C1 IS select PLANID from PK_PLAN where STOPDATE >= SYSDATE; <br />
V_PLANID PK_PLAN.PLANID%TYPE;<br />
<br />
BEGIN<br />
<br />
OPEN C1;<br />
LOOP<br />
FETCH C1 INTO V_PLANID;<br />
EXIT WHEN C1%NOTFOUND;<br />
DBMS_OUTPUT.PUT_LINE(V_PLANID);<br />
END LOOP;<br />
CLOSE C1;<br />
END;<br />
/<br />
Can I do what I am doing with CRecordset derived class? I want to capture the output of this stored proc.
I am new to using Oracle with ODBC using CRecordset. So any help would be a lot of help.
Thanks a lot for any suggestions.
ashish
|
|
|
|
|
What you need to do is return a reference cursor in your stored procedure. In your ODBC query, you need to place a parameter marker (?) in your query:
return _T("{CALL SAL2UNI_GETPLANS(param1, ?)}");
If you read the Oracle ODBC driver info, it will give complete doc on this. Also, this is how you can return multiple result sets from an Oracle proc.
EX: CALL MYPROC('ACCT1', ?, ?)
where MYPROC opens two reference cursors.
Good luck and hope this helps.
|
|
|
|
|
Hi, all
I am writing a program in Visual C++ 6.0 Service Pack 5 that uses the FlashWindowEx() function. But when I compile the program it says:
error C2065: 'FlashWindowEx' : undeclared identifier
I have included both the windows.h and winuser.h but neither declares this function, but according to MSDN the requirements are:
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Included in Windows 98 and later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use User32.lib.
I have even tried to declare it my self by writing:
#pragma comment(lib,"user32.lib")
__declspec(dllimport) BOOL FlashWindowEx (FLASHWINFO *pfwi);
But it didn’t work. I know I can use LoadLibrary and call the function from there, but it seems to strange that it isn’t declared in neither windows.h or winuser.h. Where can I find a windows.h and/or winuser.h that declares it, and I suppose that I would also need user32.lib.
Aidman » over and out
|
|
|
|
|
|
Just download the latest Platform SDK
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
regards
modified 12-Sep-18 21:01pm.
|
|
|
|