|
i'm glad you found some of the information useful.
you can also check microsoft's ADO newsgroups, i'm sure you will found someone who had same problems with ADO versions, and hopefully, a solution for it.
thanks for advice about ComCheck
|
|
|
|
|
Hi, i new to Visual C++ and have some enquery about tab control, hope to get some expert guidance.
Previously i made a tab control with 3 tabs but both 3 tabs have nothing on it. How do i customise each tab control? (Example) Such as tab1 with dropdown list, tab2 with radiobuttons, tab3 with text field.
I have seen some other project which they design each tab on its own using the dialog resource. Do i need to do it that way? If that is the case, I need to design 3 dialog for my 3 tabs ? Help really needed here.
m_tab_ctrl.InsertItem(0, "Tab 1");
m_tab_ctrl.InsertItem(1, "Tab 2");
m_tab_ctrl.InsertItem(2, "Tab 3");
i had included the above code in the CDialog::OnInitDialog();
Any solutions? Thanks in advance.
I green to Visual C++, Please be gentle to me. (Simpler terms please )
|
|
|
|
|
You have two solutions:
1) the one you mentionned (or you can also use the CPropertyPage class if you just need a dialog with only the tab control - take a look at the documentation !!)
2) if your tabs are really simple you can hide/show the controls on it depending on the active tab (hmmm, it's not a very elegant solution but I use this if the tabs arre really simple)
Hope this helps
|
|
|
|
|
Use the property sheet...
If you have to handle messages from the controls inside the tabs, it would be easier...
Here's how to start:
1. Create a new class derived from CPropertySheet (CMyPropertySheet or whatever).
2. Create one dialog for each tab you need.
3. Create a class for each dialog, but don't use CDialog as the derived class, you must choose CPropertyPage.
4. Handle all events you want to in each dialog...
5. In order to create the Property pages you should do it in the contructor of the property sheet (look at AddPage (from my memory ))
(Remember to create a variable for each dialog(propertypage) that you need to add inside the property sheet. Remember to include all the Property Pages *.h (headers) in the MyPropertySheet.h...
In order to make the results visible you'll have to call do modal...
NOTE:
if you want to create the property sheet embedded you'll have to work more, but it is also easy...
try it, if you cannot reach it, post another message.
Hope this helps...
|
|
|
|
|
I'm trying to write a program that reads state abbreviations from an input file and then outputs the corrosponding state to an output file. (this is my first class in programming)
I'm using a while loop that runs until the end of input file and switch statements to match states and abbreviations, here is a portion...
<br />
inAbrev >> firstLetter >> secondLetter;
while(inAbrev)
{<br />
<br />
switch (firstLetter)
{<br />
case 'A' : switch (secondLetter)<br />
{<br />
case 'L' : outState << inAbrev << " is " << "Alabama" << endl;
break;
case 'K' : outState << inAbrev << " is " << "Alaska" << endl;<br />
break;<br />
case 'Z' : outState << inAbrev << " is " << "Arizona" << endl;<br />
break;<br />
case 'R' : outState << inAbrev << " is " << "Arkansas" << endl;<br />
break;<br />
}<br />
I can get it to compile but my loop (and maybe my switch statements) seems to be wrong.
The problem is that it gets stuck on the first input (AL) and goes into an infinite loop of just reading that input,
it is never evaluated and nothing is output.
I'm probably missing something simple but my beginners brain can't find it.
Any help would be great.
Thanks,
Aaron
arrrgh
|
|
|
|
|
The first line should be inside the while loop.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks Joaquin, my while loop now works. However for some reason my switch statements are not being run. If you or anyone has any suggestions it would be great.
Thanks again,
Aaron
arrrgh
|
|
|
|
|
Dear All,
I am creating a dialog application using MFC , and in which i am using a "Date Time Picker control"
I want to set the time in format hh:mm.
---------
I have kept ID of control : IDC_TIME
and using the following macro in Initdialog
DateTime_SetFormat((HWND)GetDlgItem(IDC_TIME),"HH:mm");
---------
But it is not serving my purpose. I donot want to make its member variable. Can u make some modification in above code to solve the problem.
Please comment.
|
|
|
|
|
You need to get a pointer to the control - this should work:
-----------------------------
CDateTimeCtrl* pCtrl = (CDateTimeCtrl*) GetDlgItem(IDC_TIME);
ASSERT(pCtrl != NULL);
pCtrl->SetFormat("HH:mm");
-----------------------------
Hope that helps
JohnJ
Time for a but no
http://www.rainbow-innov.co.uk[^]
|
|
|
|
|
I'v built a SDI based application,and create two classes based on CWnd, in the view, i created them and set theirs parent to this view, and want the last window on the topmost, the first on the middle layer, and the view on the back, so i use SetWindowPos() function with the last window class,but it doesnt work,when i click the middle layer window ,the middle layer window appear to the top,why?
Is there anyone can give me any idea?
Thanks anyway!
|
|
|
|
|
|
In my application:
the view be the background,
the 1st CWnd based window be a portrait(middle layer),
and the 2nd be a frame(topmost layer,and with a rect hole in it),
so the three layer can make up a photo,(god,my poor english!),Can you understand?
So,i can't set one window to the other's parent,the two can be moved separately.
|
|
|
|
|
Is it possible to use ModifyStyle function at runtime?
if possible, how?? please help me.
Best regards.
|
|
|
|
|
Like this:
pWnd->ModifyStyle( 0, WS_VISIBLE );
The first parameter is styles to remove, and the second is styles to add. Multiple styles can be combined using the bitwise OR operator e.g. WS_BORDER|WS_CHILD|WS_VISIBLE.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
also, I think that not all styles are modifiable at run time (ie. with ModifyStyle ) once the CWnd is created.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I have a dialog-based application with a ListBox control on it.
I wanna popup a menu when user click right button on the ListBox.
But in MFC ClassWizard, the framework doesn't deliver WM_RBUTTONDOWN
to me for a ListBox.
How can I do to meet my requirement?
Thanks!
|
|
|
|
|
|
My Scenario:
I’m using MFC on the VC7. I have a MDI application. I wrote a class that delivered from CToolBarCtrl. I created a few button. I added ID and icon on the buttons.
UINT cButtonID[] ={ ID_FILE_NEW
,ID_FILE_OPEN
,ID_FILE_SAVE
,ID_FILE_PRINT
,ID_APP_ABOUT
};
TBBUTTON TBButtons[ICON_NUMBER];
for(int i = 0; i < ICON_NUMBER; i++)
{
TBButtons[i].fsState = TBSTATE_ENABLED;
TBButtons[i].iBitmap = i;
TBButtons[i].idCommand = cButtonID[i];
TBButtons[i].iString = i;
TBButtons[i].fsStyle = TBSTYLE_BUTTON;
}
There is a dialog (CMyToolBar). When the dialog receives WM_CREATE message, I create an object from above class. On the CMainFrame When receive WM_CREATE message, I create two objects from CReBar and CMyToolBar. Object of CMyToolBar adds to Object of CReBar (m_ReBar.AddBar(&m_dlgToolBar)).
(I think, my way is very long. I guess, there is a shorter way, but I don’t know.)
My Problem:
When I click the new file button or open file button on the tool bar, it is run. But when I click the save file button or print button, it isn’t run. What is the problem?
( I know that my English is very bad. I'm Sorry!)
Everybody thanks for your helps.
|
|
|
|
|
It might sound crazy, but try to clear your vc++ project from old temorary files. Delete your ReleaseTemp or DebugTemp. Then recompile the whole application.
I have sometimes a similar problems with my toolbars in VC++ 6.0, if I change something in the toolbar it does not work correctly until I delete all temp files and recompile.
|
|
|
|
|
:(Is there any way of accessing assembly level "Privileged Instructions", like out and in, with out having to write a kernal-mode driver. All I want to do is output a few instruction to a very simple piece of hardware, creating a driver to wrap them seems like over kill. My program, of cource, works with out a driver on Win95 and Win98.
I've already downloaded the "Driver Wizard" from codeproject and generated a project, which I will start working on tomorrow (5/10/03). Because I do not think I have a choice in the matter at this time.
Note: Once the program has insued its instructions, it is no longer required to be loaded in memory for the hardware to work.
Trust in the code Luke. Yea right!
|
|
|
|
|
I needed something like that time ago, so I looked over the internet and found the UserPort driver - it allows to use the in and out asm instructions when is installed & initialized.
For documentation how it works look @:
UserPort doc.[^]
If this is what you want, the google should help you with your next steps
|
|
|
|
|
Thank you very much.
Trust in the code Luke. Yea right!
|
|
|
|
|
hi guys
could some one tell me please how can i create database ".mdb" without using
Access? i've XP installed with office XP when i try to use table made in
Access i get error "Unrecognized file format"
please help
|
|
|
|
|
The issue is that Office is creating a mdb using a newer version of DAO/Jet (the database engine behind Access) and that MFC is using an older version of DAO (because MFC was created when DAO. In order to use the newer version DAO, you need to set an internal variable to tell DAO to use the newer version. Do this before calling ANY DAO routines.
AfxGetModuleState()->m_dwVersion = 0x0601;
Joel Lucsy
|
|
|
|
|
When reading information from the disk drive it's read wrong. Let's say this is the contents of the disk:
B3 2D 02 40 (hexadecimal)
when i read that information into a DWORD it becomes 0x40022db3. Is it possible to read the data so it becomes 0xb32d0240 in my buffer? OK. Let's say i convert this to binary:
10110011001011010000001001000000
Is it then possible to load the data into a struct from right to left instead of left to right?
so if i have this struct and the above data is on the disk, that it would put it in from right to left:
typedef struct {
unsigned int horizontal_size_value:12;
unsigned int vertical_size_value:12;
unsigned int aspect_ratio_information:4;
unsigned int frame_rate_code:4;
} info;
Thanks all!
|
|
|
|