|
slipnit wrote: Is there some way to bind the Edit control to the DataSource(ADO Control).
This is the MFC/C++ forum. MFC classes and IDE wizards produce entire data input forms for you based on a database connection which includes using RFX (Record Field Exchange) macros to transfer data between user controls and your data source (data binding). There are mountains of information and examples on msdn.microsoft.com and of course in articles here on CodeProject.
led mike
|
|
|
|
|
hi
thx.its using RFX macros.
thx slipnit
|
|
|
|
|
|
Alright, I feel stupid. In VC6, radio button groups were handled through a single integer value. I can't find anything similar in VS2005. When I try to add a variable for a radio button, it insists on using a bool/BOOL value instead of an integer. What am I doing wrong?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: What am I doing wrong?
Um, using VS2005?
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Well, I was hoping someone could provide me with something a bit less obvious.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Unfortunately, in VS 2005 you have to add the DDX_Radio entries manually to DoDataExchange.
|
|
|
|
|
This must be one of the super-secret ways they're not abandoning support for C++/MFC developers...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: This must be one of the super-secret ways they're not abandoning support for C++/MFC developers...
Apparently, this is by design. It's a reported issue - but they are not going to fix it[^]
Thnaks for reporting this problem for us. The behavior that you're refernig to however is by design. We only add DDX_... macros to the DoDataExchange method if the variable is marked as a 'Control variable'. What you probably want to do is to change 'Category' from 'Control' to 'Value'. With that you will get the appropriate things added to the DoDataExchange method.<br />
Regards,<br />
The Visual C++ Team
|
|
|
|
|
Even they're comment is incorrect. You won't get an int variable by changing the category.
If a bunch of programmers don't like the way it works, they should change it because their view is obviously f***ed up.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am not even seeing the behavior described by the bug. May be it got fixed in VS2005 SP1.
|
|
|
|
|
That's not true. It works.
|
|
|
|
|
It works for me. (Regardless of the fact that BOOL == int) you can type over the Variable Type field as shown in the image. As I cannot use img tag, I have uploaded the image here.
Radio.JPG (46.7 Kb)
And No, you don't have to add DDX_Radio manually.
|
|
|
|
|
Hi all,
I am writing one application using VC++.NET. Is it possible to get co-ordinates of HDC without knowing its associated HWND?
Thanks in Advance.
|
|
|
|
|
Do you mean the dimensions of the window?
GetViewportExtEx()/GetWindowExtEx()
Mark
|
|
|
|
|
Can you explain co-ordinates of HDC
|
|
|
|
|
Left, right, top and bottom of device context or window which is associated with that device context.
|
|
|
|
|
Can you use of hWnd of window?
|
|
|
|
|
in my application i have made XML file .
i have read it and stored content in the string after cheking the tokens i fetched the values according to the tokens and put that values in the listview.
as per following.(first folder is selected , and then file selected)
LISTVIEW
---------------------------------------------------------------------------------------------------
File | Extension | size | Duration | Bitrate | Type | ModifiedDate | protected
D:\amit\ - - - - - - -
amit.wmv wmv 296KB 00:30:00 495kbps Window 7/7/2007 completed
Media
File
====================================================================================================
xml file is below.
------------------------------
<filelist>
<listitem type="dir" order="0">
<path>D:\amit\</path>
</listitem>
<listitem type="file" order="1">
<filename>C:\Documents and Settings\Amit\Desktop\MediaFiles\TT.wmv</filename>
<extension>wmv</extension>
<size>494 KB</size>
<Duration>00:00:38</Duration>
<Bitrate>103 Kbps</Bitrate>
<Type>Windows Media Audio/Video file</Type>
<modifydated>11/22/2005</modifydated>
</listitem>
</filelist>
=============================================================
Code for that is below
when user logged.
at first time the xml file will be read.
switch (message)
{
case WM_INITDIALOG:
{
int i;
char Temp[255];
char * buff = new char[5000];
string xmlbuffer,Pathforfile,PATH;
Registry objReg;
ifstream in;
Utility util;
hList=GetDlgItem(hDlg,IDC_LIST4); // get the ID of the ListView
memset(&plvbki,0,sizeof(plvbki));
SendMessage(hList,LVM_SETEXTENDEDLISTVIEWSTYLE,0,LVS_EX_FULLROWSELECT); // Set style
memset(&LvCol,0,sizeof(LvCol)); // Reset Coluom
LvCol.mask=LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; // Type of mask
LvCol.cx=0x58; // width between each coloum
LvCol.pszText=_T("File"); // First Header
LvCol.cx=0x52;
// Inserting Couloms as much as we want
SendMessage(hList,LVM_INSERTCOLUMN,0,(LPARAM)&LvCol); // Insert/Show the coloum
LvCol.pszText=_T("Extension"); // Next coloum
SendMessage(hList,LVM_INSERTCOLUMN,1,(LPARAM)&LvCol); // ...
LvCol.pszText=_T("Size"); //
SendMessage(hList,LVM_INSERTCOLUMN,2,(LPARAM)&LvCol); //
LvCol.pszText=_T("Duration"); //
SendMessage(hList,LVM_INSERTCOLUMN,3,(LPARAM)&LvCol); //
LvCol.pszText=_T("Bit Rate"); //
SendMessage(hList,LVM_INSERTCOLUMN,4,(LPARAM)&LvCol); //
LvCol.pszText=_T("Type"); //
SendMessage(hList,LVM_INSERTCOLUMN,5,(LPARAM)&LvCol); //
LvCol.pszText=_T("Modified Date"); //
SendMessage(hList,LVM_INSERTCOLUMN,6,(LPARAM)&LvCol); //
LvCol.pszText=_T("Progress"); //
SendMessage(hList,LVM_INSERTCOLUMN,7,(LPARAM)&LvCol);//
LvCol.pszText=_T("Protected"); //
SendMessage(hList,LVM_INSERTCOLUMN,8,(LPARAM)&LvCol);//
memset(&LvItem,0,sizeof(LvItem)); // Reset Item Struct
// Setting properties Of Items:
LvItem.mask=LVIF_TEXT; // Text Style
LvItem.cchTextMax = 256; // Max size of test
ListView_SetItemState(hList,0,LVIS_SELECTED ,LVIF_STATE);
Pathforfile = objReg.GetRegistryKeyEntryValue(TEXT("SOFTWARE\\DRM"),TEXT("InstallDIR"));
PATH=Pathforfile+"Encoder"+username+SITE_ID+".xml";
in.open((PATH.c_str()), ios::in);
char str[2000];
string outstring;
bool onoff=in.is_open();
if(onoff)
{
//xmlbuffer.c_str();
//in.read((char *)&xmlbuffer, sizeof(xmlbuffer));
while(in >> str)
outstring+=str;
char *token;
char *tok = strtok_s((char*)outstring.c_str(),"<>",&token);
while(tok)
{
if(tok == NULL)
break;
else
{
string tmp = tok;
// Check for the <Profile> Node.
if(tmp.find("type") != -1)
{
//Get the profile Name and store in the vector;
{
size_t pos1 = tmp.find_first_of("=");
if(pos1 != -1)
{
string tmpType = tmp.substr(pos1 + 2); //value of tmpProName would be: profileName" ID="ENCRYPTEDID">
size_t pos2 = tmpType.find_first_of("\"");
if(pos2 != -1)
{
string inputtype = tmpType.substr(0,pos2);
if(inputtype=="dir")
{
if(tmp.find("order") != -1)
{
size_t pos1 = tmp.find_last_of("=");
string tmporder = tmp.substr(pos1 + 2);
size_t pos2 = tmporder.find_last_of("\"");
string inputorder = tmporder.substr(0,pos2);
int i=atoi(inputorder.c_str()); //find the order for display in the list view
tok = strtok_s(NULL,"<>",&token);
tmp=tok;
if(tmp.find("path") != -1)
{
tok = strtok_s(NULL,"<>",&token);
string filename=tok;
WCHAR* DIRPATH=util.ConvertStringToWCHAR(tok);
LvItem.pszText=(LPWSTR)DIRPATH;
//SendMessage(hList,LVM_SETITEM,0,(LPARAM)&LvItem);
ListView_SetItemText(hList,i,0,(LPWSTR)&LvItem); // put the listview value from here
}
/*
if(inputtype=="file")
{
if(tmp.find("order") != -1)
{
size_t pos1 = tmp.find_last_of("=");
string tmporder = tmp.substr(pos1 + 2);
size_t pos2 = tmporder.find_last_of("\"");
string inputorder = tmporder.substr(0,pos2);
int i=atoi(inputorder.c_str());
tok = strtok_s(NULL,"<>",&token);
tmp=tok;
if(tmp.find("filename") != -1)
{
tok = strtok_s(NULL,"<>",&token);
string filename=tok;
}
tok = strtok_s(NULL,"<>",&token);
tmp=tok;
if()
*/
}
}
}
}
}
/*
if(tmp.find("order") !=-1)
{
size_t pos1 = tmp.find_first_of("=");
}
*/
}
//tok = strtok_s(NULL,"<>",&token);
}
//////////////////////////end add by amit
tok = strtok_s(NULL,"<>",&token);
}
}
in.close();
//DeleteFile(mainfilename);
}
break;
|
|
|
|
|
What is the problem?
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
the value Lvitem is initalize at the time of debugging but it couldn't display in the list view.
E.g.
WCHAR* DIRPATH=util.ConvertStringToWCHAR(tok); LvItem.pszText=(LPWSTR)DIRPATH;
ListView_SetItemText(hList,i,0,(LPWSTR)&LvItem);<code>
|
|
|
|
|
amitmistry_petlad wrote:
WCHAR* DIRPATH=util.ConvertStringToWCHAR(tok); LvItem.pszText=(LPWSTR)DIRPATH;
//SendMessage(hList,LVM_SETITEM,0,(LPARAM)&LvItem); //this is not working
ListView_SetItemText(hList,i,0,(LPWSTR)&LvItem); //this is not working
Use strcpy or memcpy instead of
LvItem.pszText=(LPWSTR)DIRPATH;
Regards
Anil
|
|
|
|
|
_anil_ wrote: Use strcpy or memcpy instead of
LvItem.pszText=(LPWSTR)DIRPATH;
Just to be certain, do NOT strcpy(...) ,wcscpy(...) or memcpy(...) into pszText. pszText is a pointer, not an array. You have to assign the pointer such that it points to a valid memory location.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
You haven't put anything in the list control - this code isn't sending LVM_INSERTITEM anywhere.
|
|
|
|
|
what does it mean?
I am going to put the string which i fetched from the xml file.
Amit
|
|
|
|
|