|
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).
|
|
|
|
|
|
Thanks
|
|
|
|
|
I'm trying to create an MDI app, I want any child windows to be automatically Maximised at all times.
I've overidden the Create function and removed the style WS_SYSMENU and added the style WS_MAXIMIZE. (see bellow)
The window wtill doesn't display maximised though?
What am I missing?
Cheers
BOOL CSegmentationFrame::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CMDIFrameWnd* pParentWnd, CCreateContext* pContext)
{
dwStyle ^= WS_SYSMENU ;
dwStyle |= WS_MAXIMIZE ;
return CMDIChildWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, pContext);
}
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
try moving your functionality into PreCreateWindow.
virtual BOOL CSegmentationFrame::PreCreateWindow( CREATESTRUCT& cs )
{
cs.style ^= WS_SYSMENU;
cs.sytle |= WS_MAXIMIZE;
return CFrameWnd::PreCreateWindow( cs );
}
That may help you out. Is kinda hard to tell w/o seeing more of your source. The style could be getting overriden somewhere else.
Joseph Dempsey
joseph_r_dempsey@yahoo.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
Cheers, but that doesn't work either.
The only other code I have in the class is the OnCreateClient function. Its displaying a splitter window as bellow:
BOOL CSegmentationFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
CRect cr;
GetClientRect( &cr);
DWORD dwStyle = WS_BORDER | WS_CHILD | WS_VISIBLE;
if ( !m_mainSplitterWnd.CreateStatic( this, 2, 1 ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
if ( !m_topSplitterWnd.CreateStatic( &m_mainSplitterWnd, 2, 4, dwStyle ,m_mainSplitterWnd.IdFromRowCol(0,0) ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
if ( !m_botSplitterWnd.CreateStatic( &m_mainSplitterWnd, 1, 2, dwStyle ,m_mainSplitterWnd.IdFromRowCol(1,0) ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
for (int row = 0; row < 2; row ++)
{
for (int col = 0; col < 4; col ++)
{
if ( !m_topSplitterWnd.CreateView( row, col, RUNTIME_CLASS(CSliceView), CSize(cr.Width()/4, cr.Height()/3), pContext ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
}
}
if ( !m_botSplitterWnd.CreateView( 0, 0, RUNTIME_CLASS(CSegmentationForm), CSize(cr.Width()/2, cr.Height()/3), pContext ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
if ( !m_botSplitterWnd.CreateView( 0, 1, RUNTIME_CLASS(CHistogramView), CSize(cr.Width()/2, cr.Height()/3), pContext ) )
{
MessageBox( "Error setting up splitter frames!", "Init Error!", MB_OK | MB_ICONERROR );
return FALSE;
}
return true;
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
It works now if i just use
cs.style = WS_CHILD | WS_VISIBLE | WS_MAXIMIZE;
in PreCreateWidow.
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|