|
hi all,
I have an application which communicates with a device..and when i click on UI and start multiple UI's, fill all the details, and OK, them one after the other,
job of each UI are queued and executed one after the other..I face some kind of timing issue when I use the release version of the exe or even the debug version of .exe.
But when I just attach this process to the VisualC++ debugger , by Build -> Start Debug ->Attach to process, and i don't put any breakpoints in anywhere in the code,
then it works fine..
What i would like to know is, how the attaching this process to debugger effects any .exe..pls note, I am not putting any breakpoints...so there's no way of adding human delay..
Any ideas...
Shiva P
|
|
|
|
|
hi everybody,
I am using Visual C++.Net & going to create a MFC Project with HTML Support.There are 3 Dialogs in my Project & they inherits like this:
class firstdialog : public CDHtmlDialog
class seconddialog:public CDHtmlDialog
class thirddialog:public CDHtmlDialog
Now I want to appear these 3 dialogs using in a same window using CPropertyPage class (Like excel sheet).
I am going to do like this:-
CPropertyPage c1;
c1.addPage(&firstdialog);------But this is wrong because firstdialog Must be a inherits from CPropertyPage
How do I do that?.
anyone know these things please tell me .
If there easy way to show these 3 Dialogs in a same Window with conecting Tabs(Like excel sheet)
|
|
|
|
|
The most viable option is to use a CTabCtrl in combination of a few CDHTMLDialog objects. This is called "Creating a custom MFC class"
First, design the dialog templates, or the HTML pages to show in them. Give each of them the 'Visible: FALSE' property, so they won't be displayed automatically. An alternative is to omit the WS_VISIBLE flag in the creation call.
Then derive a new class from CTabCtrl and add an array of these HTML dialogs (CDHTMLDialog ) as a member. During construction phase, each dialog is created. When the tab control is displayed somewhere, the tab selection determines which of the HTML dialogs is visible. When the tab changes, the old dialog is hidden and a new dialog is shown.
Needless to say, for this to work, each dialog must be exactly the same size and reside in the same position. The most efficient way is to save this information from the dialog that is being hidden, then reposition/resize the dialog to be shown before displaying it.
The road you're about to venture is not an easy one. But it is doable, and shouldn't take extremely long to design/implement. But it won't probably happen overnight, unless you're a true expert of MFC
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
hi everybody,
I am using Visual C++.Net & going to create a MFC Project with HTML Support.There are 3 Dialogs in my Project & they inherits like this:
class firstdialog : public CDHtmlDialog
class seconddialog:public CDHtmlDialog
class thirddialog:public CDHtmlDialog
Now I want to appear these 3 dialogs using in a same window using CPropertyPage class (Like excel sheet).
I am going to do like this:-
CPropertyPage c1;
c1.addPage(&firstdialog);------But this is wrong because firstdialog Must be a inherits from CPropertyPage
How do I do that?.
anyone know these things please tell me .
If there easy way to show these 3 Dialogs in a same Window with conecting Tabs(Like excel sheet)
|
|
|
|
|
hi everybody,
I am using Visual C++.Net & going to create a MFC Project with HTML Support.There are 3 Dialogs in my Project & they inherits like this:
class firstdialog : public CDHtmlDialog
class seconddialog:public CDHtmlDialog
class thirddialog:public CDHtmlDialog
Now I want to appear these 3 dialogs using in a same window using CPropertyPage class (Like excel sheet).
I am going to do like this:-
CPropertyPage c1;
c1.addPage(&firstdialog);------But this is wrong because firstdialog Must be a inherits from CPropertyPage
How do I do that?.
anyone know these things please tell me .
If there easy way to show these 3 Dialogs in a same Window with conecting Tabs(Like excel sheet)
|
|
|
|
|
Hi!
Is it possible using scanf to read a string from STDIN up to a tab character? I.e. the tab character must be regarded as %s terminator somehow.
What must the format string look like?
Thanks in advance and best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Use scanset.
char s[80];<br />
scanf(" %[^\t]", s);
|
|
|
|
|
scanf() is a dangerous function because it is easy to have a buffer overflow. Try using fgets() and sscanf() instead. Both use buffers of specified size.
|
|
|
|
|
You can limit the no of characters to extract with scanf.
char s[BUFFERSIZE+1];
scanf(" %*[^\t]", BUFFERSIZE, s);
|
|
|
|
|
Bhaskar wrote:
You can limit the no of characters to extract with scanf.
char s[BUFFERSIZE+1];
scanf(" %*[^\t]", BUFFERSIZE, s);
It is true that you can specify the maximum width of characters assigned to a string. However, this is hard to read, and prone to error. Format strings are inherently hard to use (but extremely powerful).
I just re-read the help section in MSVC++, "Format Specification Fields: scanf and wscanf Functions" and I don't believe your example is valid. For one thing, it is missing a type specifier ('s').
This is such an easy mistake (which I have done myself) that it only shows the danger in using scanf(). And even if this turns out to be a valid format string, it is almost unreadable.
|
|
|
|
|
Hi guys
I've designed an App Dialog oriented, where the main dialog has the Thin Style (no title bar).
I've added a button in my app to minimize, and here I have the problem.
I could add some text to the app when is minimized with SetWindowText("MyApp").
But I can't add an icon to show left aligned as other apps.
Do you know a simple way to do this ? (SetIcon hasn't worked).
Best Regards
Doc
|
|
|
|
|
hi
i have written an algorithm for the calculation of the linear correlation coeffcient (pearson) but with its many sums it is to slow with much N. So i´m interessted in any idea how i can speed up this calculation
thanks
mike
|
|
|
|
|
Hi,
I have an application, where I need to change the color of the button on getfocus event and bring it back to the default color (grey) on lostfocus event.
Any help on how do I proceed on this please??
regards,
Ashok
|
|
|
|
|
First, instead of using standard Windows button controls, go see this article and download the sources.
Then include these sources into your project and convert the necessary buttons to CButtonST type (there are instructions on how to do this in the article). Now, during the OnInitDialog execution, use the control variables of the buttons to call CButtonST::SetColor to set colors for the following indexes: BTNST_COLOR_BK_IN, BTNST_COLOR_BK_OUT, BTNST_COLOR_BK_FOCUS.
These indexes control the background color of the button when 1) mouse is over the button, 2) mouse is outside the button, 3) button has keyboard focus, respectively.
To do what you desire without the CButtonST class, you'd need to paint the buttons completely by yourself. Difficult task, but doable.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
MFC doesnt allow you to change button's default background color. You will have to use owner drawn button and its methods to change the background
|
|
|
|
|
Subclass CButton and override DrawItem() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks for all the help.
Now I have used the owner-drawn button and able to change the color of the focused button (using WM_SETFOCUS, WM_KILLFOCUS and DrawItem).
But facing another problem:
WM_SETFOCUS is called, only if the button is clicked. Not if focus is changed using tab key or arrow key.
Can you tell me, which message should I handle for this?
regards,
Ashok
|
|
|
|
|
In my application i am using MS access database to enter records. Now, the records are not getting entered sequentially. i have a date field. so i expect that the record corresponding to today's date should be at the end of the database. they get added nywhere in between. y does this happen. how do i change it? I want sequential entry into the database and not random entry. please suggest
|
|
|
|
|
Anonymous wrote:
i have a date field. so i expect that the record corresponding to today's date should be at the end of the database.
Why?, there is no law telling in which order a DBMS should return rows of a selection if there is no 'ORDER BY' clause. And there is certainly no single way for a DBMS to store its data.
The only way you can be sure to get your data back in chronological order, and this seems to be sequential for you, is to insert an 'ORDER BY' clause on your date field in your SQL statement.
Anonymous wrote:
they get added nywhere in between. y does this happen. how do i change it?
Are you sure, have you actually decoded the .mdb file or are you assuming it because of the order on rows returned from a selection without 'ORDER BY'?
A stated above, there is no way to specifically tell a DBMS how to store its data, and when you don't specify an 'ORDER BY', you will get data in the order they are retrieved which is typically by primary key or another index. This does not tell anything about the storage of the data itself.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
|
|
i want to get a ftp client written in "socket api" for c or c++ ,not mfc CSocket and not wininet.
|
|
|
|
|
http://www.freebsd.org/
http://www.openbsd.org/
http://www.netbsd.org/
All include a free ftp client writen in C, and all include source code. Check them all out. They all started from the same code at one time, so where you see differences see if you can figure out why. (Openbsd in particular tends to make changes to prevent problems that can't happen)
www.kde.org has a ftp client in C++, but it is perhaps too complex. (it intigrates into the rest of KDE nicely, but it is written to their ioslave spec so it may not be easy to under stand) GPL, which might be a problem for you.
I'm sure there are others. Have you searched sourceforge.net? Writing an ftp client used to be a common activity for students.
|
|
|
|
|
hi,
i need to insert bitmap into a button control.plz help me.
Thankyou.
|
|
|
|
|
If you are using MFC, use the MFC class CBitmapButton class
|
|
|
|