|
I have a database with 15 fields in it. I am using to flexgrids and filling them manually by retrieving values from the database, record by record. I have placed the twogrids in two different classes derived from CRecordview, and are hooked to the database by a CRecordset dericed class,(again manually, not using bound data controls like ADO).These two view classes have their own CMDIChild derived window classes, and I am creating two different window frames,one for each, and placing them in my application as I can best possibly adjust. THe real trick comes here. In the first grid which I call an abstract grid, I am filling it up with only 8 of the 15 database fields. In the second grid which is in a different class and window, I have just one row, and I call it the detailed grid. This one row of the grid has to be filled with the database fields (All 15) only by a single record at a time. This single record is the one which I select by just clicking on the desired row in the first grid in the other class (Abstract grid). My actual question now is "Is there a way such that when I click on a certain row in the abstract grid, I capture the row number(=first field of the database = serial no = primary key)and call the LoadGrid function for the detailed grid in the other class and pass this captured row number to precisely fill the detailed grid with only that record whose serial no is same as the row number passed, and all this has to be accomplished by just a click on a row in the abstract grid?"
long live the dEvIL
|
|
|
|
|
Hello,
I'm quite irritated by the source and the MSDN Library for CCommandLineInfo. For the documentation of ParseParam it says:
The framework calls this function to parse/interpret individual parameters from the command line. The second version is only available in Unicode projects.<br />
<br />
virtual void ParseParam(<br />
const char* pszParam,<br />
BOOL bFlag,<br />
BOOL bLast<br />
);<br />
virtual void ParseParam(<br />
const TCHAR* pszParam, <br />
BOOL bFlag,<br />
BOOL bLast<br />
);
But in the header I find the following declaration:
virtual void ParseParam(const TCHAR* pszParam, BOOL bFlag, BOOL bLast);<br />
#ifdef _UNICODE<br />
virtual void ParseParam(const char* pszParam, BOOL bFlag, BOOL bLast);<br />
#endif
It is the other way round. Using a char* in Unicode projects and TCHAR* in multibyte projects???That doesn't make sense to me because then one declaration would be enough (TCHAR is actually a char in multibyte projects). But after debugging it with Visul C++ 7.1 it seemed that the code of the MFC doesn't belong to the used MFC library, because independent on wether I build Unicode (with _UNICODE and UNICODE defined) or not the ParseParam with TCHAR is always used. Is this correct?
I ask because I want to extend CCommandLineInfo for my own parameters and I don't know which declaration of ParseParam I have to derive. I will build my app as Unicode as well as multibyte string executable.
Could someone help me in this issue.
Thanks in advance Konrad
|
|
|
|
|
The documentation has it backwards, the first one (const char* ) is only available in unicode builds. AFAIK it is provided so that unicode apps can handle an ANSI string being passed in as the commandline. You will notice that the const TCHAR* version is available in both unicode and ansi builds.
I would override the const TCHAR* version.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Thank you very much. That would be an explanation, but obviously it is not right. If you have a look at the code of CWinApp
void CWinApp::ParseCommandLine(CCommandLineInfo& rCmdInfo)<br />
{<br />
for (int i = 1; i < __argc; i++)<br />
{<br />
LPCTSTR pszParam = __targv[i];<br />
BOOL bFlag = FALSE;<br />
BOOL bLast = ((i + 1) == __argc);<br />
if (pszParam[0] == '-' || pszParam[0] == '/')<br />
{<br />
bFlag = TRUE;<br />
++pszParam;<br />
}<br />
rCmdInfo.ParseParam(pszParam, bFlag, bLast);<br />
}<br />
}
Here you can see that the parameter is wchar_t* for Unicode and char* for multibyte as parameter. So in every condition the TCHAR variant gets called! Do you have any explanation for this.
Regards
Konrad
|
|
|
|
|
WMI Blues
I am trying to set the NIC properties on a local machine using WMI. The code to do this is written in C++. I have a windows service and the code to set the NIC settings is handled in that service.
Problem:
I can get two of the properties always (does not matter which one like ip, default gateway or DNS) to set. However, on the third attempt to set any property, the connectServer () function fails (connect server function is required to get the namespace). I tried another experiment, when I restart my service after setting a property it will always work. The CoInitializeSecurity settings are exactly the same as the one in my MFC app. I am clueless at this point and I have a hunch that the code to set NIC settings residing in a service has got something to do with my program not running properly.
Note: I created a test MFC application that uses all my above functions and it works well all the time.
Any help will be appreciated
Thanks
newbee78
|
|
|
|
|
I have written a custom app wizard using C++ on .NET. It implements the IDTWizard interface. I've got the UI pretty stable. Now, I'm moving onto the template file generation. I'd like to use the IVcWizCtl interface, but, I can't seem to obtain this object. I've generated a wrapper class in my project for VcWizCtl using a typelib, but, I can't find a way to hook up to the object to use its methods. Has anyone else attempted to write a custom wizard using the IDTWizard interface? I could use some help resolving this.
Gort...Klaatu, Barada Nikto!
|
|
|
|
|
Hi...
Maybe I am oversimplifying this. I think there should be an easier and more intuitive way to package and deploy an MFC dialog app with .ocx activex controls in it other than InstallShield.
I contend that one should just be able to deliver the .ocx file, the app's .exe file and "register" the activeX controls using regsvr32.
I am using Visual Studio 6. The app runs great on the computer that I built it on but won't run anywhere else.
I have lost a lot of hair trying to get InstallShield (the version that comes with Visual Studio) to work for me and my method of deploying/registering doesn't work either.
Does anyone have an easy way to package my stuff so I can run it on another computer?
Thank you in advance
CG
|
|
|
|
|
|
Thanks Ravi....
From what I can see (and I haven't looked deeply into it) Inno Setup is script based too. Therein lies my problem with non-intuitivity (nice word eh?).
Thanks again
CG
|
|
|
|
|
|
|
Hi,
Does anyone know a way of dynamically changing the header title and sub title in a 97 style wizard? These are the 2 lines of text shown in the white section at the top of each page and are normally set during construction of each CPropertyPage like so:
<br />
m_psp.dwFlags |= PSP_DEFAULT|PSP_USEHEADERSUBTITLE|PSP_USEHEADERTITLE;<br />
m_psp.pszHeaderTitle = _T("Earlier Projects."); <br />
m_psp.pszHeaderSubTitle = _T("Choose a project from the list and click next to ...."); <br />
Specifically I would like to change the HeaderSubTitle at the point the page is being activated since the action that will happen next depends on an earlier selection that the user made.
Cheers,
Jason.
Melbourne. Australia.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
I am pretty sure those controls are two static controls displaying the text.
If you use SPY++ you might be able to identify the control identifiers and then just use SetDlgItemText on them to change their text dynamically, as you desire.
|
|
|
|
|
there are two hidden member variable of CpropertyPage
m_strHeaderTitle := for changing the Header
m_strHeaderSubTitle := for chaning the Sub Header.
just try them out.
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I want to set the view area for the controls.
For e.g. consider a button. I first create a button as.
CRect rc(0,0,20,20);<br />
CButton* pButton = new CButton();<br />
pButton->Create(_T("New Button"), WS_CHILD | BS_FLAT | WS_VISIBLE, rc, m_pMainWnd, 0);<br />
pButton->BringWindowToTop();<br />
pButton->MoveWindow(rc);
The above code creates a button at (0,0,20,20) of the main window.
Now wat i want to do is set the view area for the button control. i.e. if I set the view area to (10,10,20,20) then the button's portion for (0,0,10,10) is hidden from view and only half of the button is displayed. So How to set the view area of a control.
Thanx in advance.
|
|
|
|
|
i'm developing an ActiveX controls. when user click anywhere in the control, a dialog box should appear and in dialog box there is field for controls background color.
My question is why should i use PropertyPage instead of a dialog box ?
|
|
|
|
|
Hi all,
I need to get the proxy username and password from the registry, but I don't know how!
I tried to use InternetQueryOption(NULL, INTERNET_OPTION_PROXY_PASSWORD, ...) but that returns an error that I should use a valid handle.
Is there a way to get general proxy username and password? I don't want to ask my users about this, because most people don't know this information.
I also want to know the automatic proxy configuration URL.
Thanks!
Geert
http://geert.yoki.org
|
|
|
|
|
Hello Everybody,
I have a problem and maybe one of you can hand me a beautifull solution.
I spend many hours finding out how do to that nice plug-in effect in IE (Like acrobat does), and now I want it too!
I found out I can start a MFC application, make it a full server (so I can run it stand-alone AND in an Active container(e.g. IE)), BUT i'm a totally newbie concerning MFC and I'm searching for a way to design Forms design-time just like I can do in a form application.
uhmm.... help?
Paul
|
|
|
|
|
Can some1 plz tell me how to get table name and field name from SQL in MFC VC++ using ODBC
|
|
|
|
|
It's been several years, but the last time I used Microsoft SQL Server, I spent a few hours wading through all of the stored procedures. Not only were they easy to read, they were commented. If you have access to the machine, I would suggest you do the same. I learned so much. Retrieving table names, user properties, machine statistics, etc. is just the tip of the iceberg.
Once you figure out what stored procedure) you want to use, it's very simple to call it from the client side.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
You can query the table and column names from the system tables sysobjects and syscolumns.
e.g.
<br />
select sysobjects.name as TableName, syscolumns.name as ColumnName from sysobjects<br />
inner join syscolumns on syscolumns.id=sysobjects.id<br />
where sysobjects.type='U'<br />
I Dream of Absolute Zero
|
|
|
|
|
I need to make a program to read macro code from microsoft office file,such as to read macro code from file which extention name is .doc,how can I implement this.
hiall
|
|
|
|
|
hi I am now first time visite your site.
I'd like know how can i read from doc files and how can i modfiy on it.
|
|
|
|
|
oh... if u will have an issue and finnally recognize doc file format let me know too)
4apai
There're no impossible tasks. There're tasks that required infinite period of execution time.
|
|
|
|
|
The first thing that comes to mind is Automation. Check out MSDN article Q178749. It deals with Excel, but with only a few changes, Word can be used too. However, I do not know if macros can be read using the available interfaces.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|