|
My Friend...
I have done what all you said. I made my own class which had the base class as CRecordSet. It asked for the details of the database and everything else. It created the class in which all the field members of the database were accesed by a global variable m_pSet,
for eg. m_pSet -> Name
where Name is a field of the database.
Now i have, say a edit box on my dialog resource, and i want to display the Name field in it. I will go to the class Wizard and Member Variable Tab. there i will have to assign the variable of this edit box, say
IDC_NAME = m_pSet -> Name
Now since there is no CRecordView class, so this cannot happen, which in the normal cases of SDI or MDI which have CRecordView as the base class give the option to assign these variables.
My problem lies here that how to assign any resource variable to the field variable as i said above.
Please do let me know how this can happen....
Pankaj
|
|
|
|
|
Oh 4 that, you must have to add a member variable to the edit control say m_myname, and you must have to passon the value m_pSet->Name into this and must have to call updateData function
m_myname = m_pSet->Name
UpdateData(FALSE);
The best way is to write a function say getvalues(), which gets all the values from the recordset and displays it on the dialog.
I do think there is another way to bind direclty is there, but couldn't remember it. Just go throught the MSDN. Usually what i'll do is i'll write my own class 4 data manipulation
Sujan
|
|
|
|
|
Thanks....this is one method that did not strike me....this can be done and i am sure it will work.
But usually what happens is that in the class wizard we get a combo box in which all the member variables are stored by default, we just have to choose for which resource which field variable we have to assign. In this case no coding is required.
But as you said i think by coding in this manner, the work will be done.
Anyways, Thanks a lot !!!
Regards,
Pankaj
|
|
|
|
|
Hi! it's me again!!! I like to know how to store a image into a variable under MFC?
Eg. I declared a global variable with an array:
<br />
int n; <br />
n = (512-(Recty+1))*512 + Rectx;
int image512;<br />
image512[n];.......
<br />
int dcmpixel [40] [40];<br />
<br />
int i, j;<br />
|
|
|
|
|
Can't you use the CImage class?
|
|
|
|
|
hi all ,
i am using Ado in mfc and i want to insert a record in the recordset but not in the database. Could i insert a record in recordset after i close the connction to the database.
if some one can help
pls reply soon ....
|
|
|
|
|
I am not exactly sure whether it can be done or not, but even it can be done or not, what will you do by inserting a record in a recordset if you do not want to insert it in the database.
As far as my knowledge goes, the recordset is used as an interface between the user and the actual database, and once the connection is closed with the databse the recordset will not exist !!!
Pankaj
|
|
|
|
|
I know you can have disconnected recordsets in ADO. I think you do this by setting the ActiveConnection property of the Recordset to NULL. As far as inserting a record I would imagine it would work. Hope this helps.
|
|
|
|
|
When building for UNICODE, I'm getting a C4005 warning for a redefition of the UNICODE macro for each file in the project as each file includes stdafx.h, which in turn ultimately defines the macro.
Besides using a pragma to ignore the message, is there something else that I should be doing to build a UNICODE project without getting these warnings?
Cheers,
Tom Archer
"Use what talents you possess. The woods would be very silent if no birds sang there except those that sang best." - William Blake
* Inside C# -Second Edition
* Visual C++.NET Bible
* Extending MFC Applications with the .NET Framework
|
|
|
|
|
Tom Archer wrote:
is there something else that I should be doing to build a UNICODE project without getting these warnings?
You could put the definition on the command line (-DUNICODE ) rather than in stdafx.h.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
Sorry, i misread your question. What defines are specified on the command line? _UNICODE or UNICODE or both?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
Tom Archer wrote:
Both
Have you tried defining just one of them? MFC/ATL uses _UNICODE but the windows headers use UNICODE, so afxv_w32.h and atldef.h have a section to synchronise them if they're not both set. They shouldn't define them if they're already defined, but might be doing so... The windows headers pdh.h and oledlg.h also do this synchronisation.
Hope this helps
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I am trying to gradually blend a bitmap onto the primary surface, it works one time but when I try to do it again, the lpDDSBack.lpSurface is set to 0x000000,which it was not in the first execution!, and I am getting an exception error,
how could this be?
First I load the bitmap into the directdrawsurface lpDDSBitmap using the DDLoadBitmap function!
win* p;
typedef struct win
{
LPDIRECTDRAW lpDD;
LPDIRECTDRAWSURFACE lpDDSPrimary;
LPDIRECTDRAWSURFACE lpDDSBack;
LPDIRECTDRAWSURFACE lpDDSBitmap;
LPDIRECTDRAWCLIPPER lpClipper;
}
p->lpDDSBitmap=DDLoadBitmap(p,p->lpDD,L"crystalcocktail.bmp");
IDirectDrawSurface * DDLoadBitmap(win* p,IDirectDraw *pdd, LPCTSTR szBitmap)<br />
{<br />
HBITMAP hbm;<br />
BITMAP bm;<br />
IDirectDrawSurface *pdds;<br />
<br />
hbm=SHLoadDIBitmap(szBitmap);<br />
if (hbm == NULL){<br />
return NULL;<br />
}<br />
<br />
GetObject(hbm, sizeof(bm), &bm);
<br />
<br />
<br />
pdds = CreateOffScreenSurface(pdd, bm.bmWidth, bm.bmHeight);<br />
if (pdds) {<br />
DDCopyBitmap(pdds, hbm, bm.bmWidth, bm.bmHeight);<br />
}<br />
<br />
DeleteObject(hbm);<br />
<br />
return pdds;<br />
}
And then I Blit the bitmap surface to the Backbuffer using the Flip_Bitmap_To_Back(p):
bool_t Flip_Bitmap_To_Back(win* p)<br />
{<br />
HRESULT ddrval;<br />
RECT rcRectSrc;<br />
RECT rcRectDest;<br />
POINT pt;<br />
<br />
pt.x = 0; pt.y = 0;<br />
ClientToScreen(p->Wnd, &pt);<br />
GetClientRect(p->Wnd, &rcRectDest);<br />
OffsetRect(&rcRectDest, pt.x, pt.y);<br />
SetRect(&rcRectSrc, 0, 0, 472, 286);
ddrval =IDirectDrawSurface_Blt(p->lpDDSBack, &rcRectDest, p->lpDDSBitmap, &rcRectSrc, DDBLT_WAIT, NULL);<br />
if(ddrval==DDERR_SURFACELOST){<br />
restoreAll(p);<br />
}<br />
}
And then finally I uses the blendfunction
BltAlpha(p->lpDDSPrimary,p->lpDDSBack,0,0,&r,128,RGBMODE_565); //var RGBMODE_565
}
If I do this one more time the exception error occurs, and I don´t know why, could it be that the surface gets lost in some of the actions or?????
Please help me someone, thanks Dani
|
|
|
|
|
Hi,
I'm looking for a way to start out a standard C++ Console Application in full-screen. I know that once the app has started the user can press Alt+Enter, but it'd be really neat if I could figure out a way to get around that.
Anybody know of the code snippet to do something like that?
Thanks in advance for any help
Makutu the amateur programmer.
|
|
|
|
|
Add shorcut to your app and change behavior in "paramerts" tab.
|
|
|
|
|
Thanks but I kinda already knew that.
Is there any way to make opening in full screen mode be embedded into the executable itself?
|
|
|
|
|
I'm trying to use CxImage Library from codeproject..
But I realized that it is not so fast..
My favorite image viewer IrfanView shows really fast operation..
Which library do you think they use?
Which is the best FREE library?
ImageMagic? CxImage? GDI+?
I wish the library should be easy to use and FAST..
|
|
|
|
|
Go for Com Interface IPicture and for sampele download loadpic.exe from MSDN
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
What is the differance between c++ and visual C++
|
|
|
|
|
C++ is the pure standard language... (in theory).
now, each compiler can implement all (or more or less) of the grammar of the C++. that is the case of microsoft with its Visual suite.
Visual C++ that is compiled by the microsoft compiler contains specifics, that is why we commonly use this name to difference it from the others...
is that clear now ?
TOXCCT >>> GEII power
|
|
|
|
|
Have you learn c#? I`m thinking of learning it.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
nop, and i don't want to... i love tyoo much my c++ to learn for a "Microsoft extension of .NET object language"... you well understand, i don't like C#... (shame on me maybe, but the few i already read about it didn't interrest me).
TOXCCT >>> GEII power
|
|
|
|
|
At first, I didn`t like it, but now i kinda like it.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|