|
pnpfriend wrote: I used
::UpdateWindow(m_hWnd); and ::UpdateWindow(::GetParent(m_hWnd));
in my program so i can see the updated control data on window dlg data.
What exactly are you updating? UpdateWindow() updates the client area of the specified window (or control) by sending a WM_PAINT message to it. Is that what you are expecting?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yes.. I think that I am expecting.
I have static control that keep track of num of files in the loop like 1 2 3 4 5 ..
in debug mode, you can see the num of files: increasing as the loop goes on even you open other windows. If it is not running in debug mode, the increasment still as soon as i touch other windows. It looks like the program is freezed but busy working.
Isn't ::UpdateWindow(m_hWnd) solution to this? What am I doing wrong?
Thanks
|
|
|
|
|
pnpfriend wrote: Isn't ::UpdateWindow(m_hWnd) solution to this?
Not hardly.
pnpfriend wrote: What am I doing wrong?
You need to create two CStatic variables, one for each control. Make sure the DoDataExchange() method is correct:
void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_STATIC1, m_static1);
DDX_Control(pDX, IDC_STATIC2, m_static2);
} Now when you need to update them, simply call SetWindowText() like:
int nCounter = 1;
CString strCounter;
strCounter.Format("%d", nCounter);
m_static1.SetWindowText(strCounter);
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yes David.
That's what I have.
It gets updated.. But it is just doesn't show it anymore as soon as after I touch or click or focus on other windows.
The dialog looks like it got frozen. It no longer update any controls on dialog. All the dialog controls become alive or awake again when it gets out from the loop.
I thought inorder to prevent from dialog to get looks frozen, I have to call ::UpdateWindow(m_hWnd) to update or redraw the whole dialog including every controls that I have on dialog.
|
|
|
|
|
pnpfriend wrote: It no longer update any controls on dialog. All the dialog controls become alive or awake again when it gets out from the loop.
That indicates that you're doing the work in the main UI thread. The UI is not going to be responsive as a result. You can use SetWindowText() to update the control immediately if that's the only problem you have, otherwise move the loop to a worker thread.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thanks
I had changed to worker thread.
it is working.
thanks.
|
|
|
|
|
thanks for your answers.
What I meant is:If there is a simple way like in Visual Basic where you right click at the properties of the button and you can change the back color the color you want.
Is there some thing like this in visual studio C++?
thanks again
|
|
|
|
|
|
There is nothing like what want in VC++,we have to write it
from Scratch.
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
Not in the dialog designer, but you can handle the WM_CTLCOLOR message and set the background colour there.
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"
|
|
|
|
|
|
Hello everyone.
I have a simple question.
How can I give the buttons or forms a color
like in visual basic ?
Thanks in advance !
-- modified at 12:38 Monday 10th April, 2006
|
|
|
|
|
you maight find what you want here[^]...
|
|
|
|
|
Hi hektor kashuri,
I suggestion that you derived CButton and use WM_DRAWITEM
|
|
|
|
|
As others have pointed out, there's no VB-like "background color" property you can set. Instead, you'll need to paint the button yourself. See this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
hi there,
i need to send the decimal number "2" as a parameter to a function, but the method passes this parameter as a (u_char *). how can i stop this number from being converted to its ascii value of 50 when passing it through the parameter.
i can't send the ascii value of "2", as this is defined as STX in ascii table.
ian dineen
|
|
|
|
|
"2" is not a number but a C-Style null terminated string (actually, an array of two chars : { '2', '\0' } .
idineen wrote: how can i stop this number from being converted to its ascii value of 50 when passing it through the parameter.
can you show us a piece of the code by which you call the function, and how the function uses this parameter too ??
i'm quite sure you don't use it properly.
|
|
|
|
|
the code below is used to put a snmp object id into a pdu packet along with 3 parameters. the third parameter is used by the program to identify that the paramter is interrupted as a integer. the 4th parameter "test" is the number that i want to pass, this parameter is of type "(u_char *)" and the last is the length of the string.
snmp_pdu_add_variable(pdu, oid, oid_length, ASN_INTEGER , test, strlen(test));//
thanks
ian
|
|
|
|
|
Hi Idineen:
Do you have access to the source code of snmp_pdu_add_variable?
It could be that all variables are passed in as u_char*, then because of ASN_INTEGER, that function has code to convert it to an integer from the string value in test.
|
|
|
|
|
Try this:
int test = 2;
snmp_pdu_add_variable(pdu, oid, oid_length, ASN_INTEGER, reinterpret_cast<u_char*>(&test), sizeof(test));
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"
|
|
|
|
|
|
> Should i set async read/close on the newly created socket?
The newly created socket will inherit the event mask from the server socket. It depends on the implementation of the async socket class that you use, set the events you are interested in the server socket instance and from there you create more sockets in your 'accept' handler (which will then use the same event mask).
Do not try to read data in the 'accept' handler. Have a 'read' handler which will tell you when there is (more) data available.
-- modified at 13:11 Wednesday 19th April, 2006
|
|
|
|
|
hello,
i have iexp6.0 with xp professionnel.
my code => chCtrlFrameBrowser:WebBrowser:Navigate(pcFileName,"",{&WINDOW-NAME},"","").
My problem is when i want to open a file (*.*) in a browser, it opens outside my browser and insidne my browser, it indicates a error message :
================================================================================================
Action annulée
Internet Explorer ne peut pas ouvrir la page Web requise. La page n'est peut-être pas disponible temporairement.
--------------------------------------------------------------------------------
Essayez de la manière suivante :
Cliquez sur le bouton Actualiser ou réessayez ultérieurement.
Si vous avez déjà visité cette page et souhaitez voir ce qui a été stocké sur votre ordinateur, cliquez sur Fichier, puis sur Travailler hors connexion.
Pour obtenir des informations sur la navigation hors connexion avec Internet Explorer, cliquez sur le menu ?, puis sur Sommaire et index.
Internet Explorer
=================================================================================================
Do you have any solutions.
Thanks.
MK.
|
|
|
|
|
i think you should translate what your browser tells you, because most people here speak english only...
here is the translation :
Action Canceled
Internet Explorer cannot open the requiered web page. The page may be temporarily unavailable.
------------------------------------------------------
Try the following mean :
Click the Refresh button or retry later.
If you already visited this page and wished to see what has been saved on your computer,
click on File, then Work offline.
For further informations about offline navigation with Internet Explorer, click on the ? menu, then on Contents and Index.
|
|
|
|
|
i am using InstallShield for VC++6 to create automated setup
of my project . So far i am able to create the setup.
but i have special need to create around six folders
in the default C: drive.these folders in C: drive will contains main data which my project needs.How can i do this with InstallShield for VC++6?
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|