|
i have 2 CEdit (CDialog) i want to search if the text from CEdit (1) matches with 1 record (in my database )( my database visualfoxpro - CRecordset - snapshot ) and the matches must fill in the second CEdit ! how ?
thanks !
Bravoone
|
|
|
|
|
I find the easiest way is with a parameterized recordset. Please do not ask what that is without searching for it yourself first. You can either use Google, or peruse the CP articles. Hint: one of my articles has an example.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i just want to integrate the mysql installer inside the c++ appliction.
I think its possible
since i had seen some of the client side installation software that performs the said task.
if i run the c++ application, it will prompt for the mysql installation.
The mysql installer then will be installed in the client machine.
If any dude out there possibily put some light into this matter will be heartly appreciated...
never be late or time will ate
|
|
|
|
|
Hi,
I have created a List control in report view using gridlines as follows
m_StoreItems.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
I need to create a combo box in a column seperated by gridlines.
Can u please help me.
thannks in advance.
|
|
|
|
|
|
|
I want to remove the frame for SDI Application?
How can i do it?
and even menu and tool bar also i want to remove..
|
|
|
|
|
You need to remove WS_OVERLAPPEDWINDOW style from windows style you are using
Make your CMainFrame::OnCreate function look like this
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
ModifyStyle(WS_OVERLAPPEDWINDOW,0);
}
|
|
|
|
|
Thank you,
i want to know how to put colors for the windows and for the controls which is on the window
|
|
|
|
|
you need to override OnPaint if window is CMainFrame.For controls you need to make them owner drawn, and handle its appearance in OnDrawItem.
|
|
|
|
|
i Want to get the Coordinates of the of my MDI Window, from a function of the class defined Below
class CGUIControlFrame : public CMDIChildWnd {
}
void CGUIControlFrame::OnDestroy()
{
.
.
GetParentFrame()->GetWindowRect(Rect);
.
.
}
I have Used GetParentFrame()->GetWindowRect(Rect); to get the coordinates But its is Not working.
Can Any one help me.
|
|
|
|
|
you can't get it there. Window no longer exists at that point.
|
|
|
|
|
I am writing a graphic design tool. I am using a device context to produce the image on screen. Now I want to be able to print the image to the printer. What I am doing so far is:
Create the screen device context : CDC *m_pDC = CreateDC ();
Do all kinds of weird and wonderful things to produce the image (all of this works, since I do get the image I want on screen)
When the user presses the Print option from the menu, I use the CPrintDialog class to select the printer, and subsequently I get a HDC by “CPrintDialog Print.CreatePrinterDC ();”
Then I calculate the size on paper by the following piece of code:
POINT point;
POINT start;
point.x = GetDeviceCaps (hDC, PHYSICALWIDTH);
start.x = GetDeviceCaps (hDC, PHYSICALOFFSETX);
point.x -= (start.x*2);
point.y = GetDeviceCaps (hDC, PHYSICALHEIGHT);
start.y = GetDeviceCaps (hDC, PHYSICALOFFSETY);
point.y -= (start.y*2);
DPtoLP (hDC, &point, 1);
DPtoLP (hDC, &start, 1);
I already have a POINT named “Source”, that holds the size of the screen DC.
Then I call:
if (!StretchBlt (hDC, start.x, start.y, point.x, point.y, m_pDC->GetSafeHwnd (), 0, 0, Source.x, Source.y, SRCCOPY))
And this is where all goes wrong! This fails, and the error message (as obtained by FormatMessage and GetLastError) says: “The parameter is incorrect”
As far as I can see, the size on paper is correct, since I also write a (test) rectangle with these positions: Rectangle (hDC, start.x, start.y, point.x, point.y); and this produces a rectangle on paper with the size and position as I would expect.
Can anyone help me out here.
William
-- modified at 7:29 Thursday 17th August, 2006
|
|
|
|
|
|
Sarath,
Thanks for the tip. I checked the link, but it does not solve my problem, since it does not refer to sending the captured image to the printer. I do have a device context with a valid image. However, when I try to copy this image into a printer device context (using StretchBlt), I get an error message.
William
|
|
|
|
|
Before using stretchblt, i think you need to set SetStretchBltMode
printing to DC is not a big deal. it's same as using CDC
|
|
|
|
|
some devices cannot handle large bitmaps (see GetDeviceCaps(...RASTERCAPS), so you have to do your output in bands. some devices cannot do StretchBlt or StretchDIBits (again, see GetDeviceCaps)
|
|
|
|
|
Engberts wrote: if (!StretchBlt (hDC, start.x, start.y, point.x, point.y, m_pDC->GetSafeHwnd (), 0, 0, Source.x, Source.y, SRCCOPY))
6th parameter of API is HDC,whats is m_pDC->GetSafeHwnd () ?
I guess you are passing incorrect type of parameter. It should HDC(source).
|
|
|
|
|
Sorry, this is a typing error, I of course used GetSafeHdc () and not GetSafeHwnd ().
Meanwhile however, I think I found the solution. Since I am copying bitmaps between diferrent devices, I cannot directly BitBlt or StretchBlt between them. I am now using GetDIBits to get the device independant bits out of the screen's device context and then use StretchDIBits to move them into the printer's device context. This does require a lot of programming, but it does result in the required image on paper.
Thanks to you all for your efforts!
William
|
|
|
|
|
Never mind. Importantly, you shared your solution, that's great !
|
|
|
|
|
Hi! i want to write a '.txt' file getting data from a 'multiline edit box'. when i want to go to the next line in an edit box do i press ctrl+enter key? when i use this it gives an extra space character (" ") which spoils the format in the text file i am writing in.
i have also used 'endl;' in the instruction for writing to a file.
outfile << testdata << endl;
if i dont give endl; it gives me two line spaces in between each line in the text file, which again ruins the required file format. does anyone know what i can do to overcome this problem?
thanks!
meriawaz
|
|
|
|
|
Hi,
You need to create the editbox with the "Want return" style. This can either be done from the dialog design (if your application is dialog based) by selecting the "Want return" option on the "Styles" tab. Otherwise, you need to specify the "ES_WANTRETURN" style when creating the editbox.
Success,
William
|
|
|
|
|
Hi,
I am getting one char name from my program..For ex:
char szTemp[10];
szTemp is "DESIGN"..
With the same name i have folder in my drive like c:\Model\DESIGN..
I have to check whether the folder is present in that drive from my code...Pls any one help is there anyway to do this..I think but i didn't get any idea...
If the folder is present then i will do some functionalaties otherwise i return one messagebox that the folder is not there...
Anu
|
|
|
|
|
|
I used that but it shows error as
'PathFileExists' : undeclared identifier.. so that i include
#include "Shlwapi.h" as i found in MSDN but again it shows error as"
unresolved external symbol __imp__PathFileExistsA@4
.\WinDebug/InstructorStation.exe : fatal error LNK1120: 1 unresolved externals"
Why it occurs like this..
Anu
|
|
|
|