|
Hi
This may work, but MUST HAVE TO CHANGE THE STYLE of the dialog template(THIN etc)
Sujan
|
|
|
|
|
anless change name of base class from CDialog to CPropertyPage u need to change in macross to (IMPLEMENT_DYNAMIC(..., CPropertyPage) and in BEGIN_MESSAGE_MAP(..., CPropertyPage) and change anywhere in code where is use base class After that u must create object from CPropertySheet to wich you add your dialogs .... and it wil work
|
|
|
|
|
Can anyone out there show me a simple way to change a CListbox font i'm using in a Pocket PC app. Everything I've tried only seems to change the size of the selection highlight, not the font itself. in particular I want to use "Courier" size 8. An other way I tried to tackle the problem was to change it in the .rc file, but it seems I can only change the whole dialog. (ie all controls) Is is possible to change just the listbox font in the .rc file?
|
|
|
|
|
Hi....
I wanted to know whether we can create a dialog based Appliocation having document/view support, indirectly saying to have databse support in a dialog base application.
After entering the application wizard, in the second step it asks for the type of application to be built. if we go for SDI or MDI we can choose the document/view option and then canchoose our data source. But if we choose the dialog based application, then the option for choosing the data source is no more available.
Now how to give this dialog based application the database connectivity ???????
And further more if we are calling further more dialogs from the first dialog window then the connectivity should be there for all the windows.
Anyone.....
Pankaj
|
|
|
|
|
Hi,
Create a Dialogbased application, Add a new class to it using classwizard. Choose the base class 4 the newclass as CRecordSet, it will ask 4 the other db informations
Sujan
|
|
|
|
|
Tha is okay....but when it comes to attaching the member variables with the fields of the database, then the CRecordView class is required. I stuck up here when i have to attach the member variables. Please help in this matter then i suppose it will work successfully !!!
Do reply....
Pankaj
|
|
|
|
|
Hi,
while adding the Class itself, it will ask for the name of the datasource/db. When you give it, it will automatically add the fields to the newly created class, which is derived from CRecordSet.
Where R U getting the CRecordView ???.
Sujan
|
|
|
|
|
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?
|
|
|
|