|
|
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.
|
|
|
|
|
I downloaded the full Platform SDK package and installed the Core SDK part.
But what do I do next? Do I just copy the .lib and .h files manually?
Aidman » over and out
|
|
|
|
|
In the vc++ options (extras->options->paths/directories), you need to set the paths to your headers and libs of the platform SDK. Make sure they are at the top of the list in the options.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks! It worked
Aidman » over and out
|
|
|
|
|
My menu items from the main menu stay disabled even after I add an ON_COMMAND message handler to my .cpp file probably b/c the object from that file is not receiving the message. I understand that command messages are routed by the main frame object to the view, document, and appln objects. How do I have command messages routed to objects other than those? Thanks,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Override your document's OnCmdMsg function and call your object's one. The object must be derived from CCmdTarget to implement a conventional message routing.
Regards,
BB
|
|
|
|
|
I have a MS Chart Control on a dialog and it displays without any difficulties on any development platform but on a test PC it fails without error. When I imported OLE Viewer and Depends to debug the system, Depends showed no difficulties but the OLE Viewer would not expand the chart control and returned an error say control was not licensed. As I have the professional version of Visual Studio, I do have redistribution rights of the control. What am I missing?
|
|
|
|
|
Hi,
I am trying to add functions to buttons on my dialog and when I double click on the button, instead of creating for me the function, it says:
"Cannot add new member"
I remember having trouble creating this dialog, is there any file I can delete/fix ?
Thanks
shay
|
|
|
|
|
I'm trying to use my friends DLL in my own DLL. I've declared it as private member and Initialized it one function, first function. It works fine here. When I call this existing object from second function, it says "cant read the memory"
I'm always wrong....whats appropriate way?
thanx in advance.
|
|
|
|
|
Hi,
I have a MDI APP with three dialog that cannot move and that intersect with each other. They must be in a specified z-order. Is it possible to do that? Actually, when I click on one of them, the clicked dialog get focus and become on top of the other two. So I would like my dialog to act so that if I click on one of them, he get focused but dont become on top of the other two.
Thanks!
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Try playing with DeferWindowPos()
~RaGE();
|
|
|
|
|
Does anybody can give me link to the guides/articles/tips of creating owner drawn controls (like ButtonST).
|
|
|
|
|