|
Any one interested in this let me know. It has been sent to Tarek alraedy.
Briefly, its a dialog derived class that has a WM_TIMER, pops up by call to DoModal() and then closes itself once the timer value is reached in the WM_TIMER handler.
Seeya!
Masoud
|
|
|
|
|
I have an ANSI C++ console application. I'm prompting the user for a password which I'm retrieving using the cin object. The problem is, I'd like for the password to not be shown while it's typed. If possible, I'd prefer to show asterisks like it's done on Windows, but I'd be happy with just showing nothing.
How can I do that?
Thanks!
Alvaro
|
|
|
|
|
Note: there's no mouse in the computer.
In my industrial app. (to control a machine) there is a time counter that shows the elapsed time while the machine works.
If I move any dialog the time counter gets stopped.
Since the PC has no mouse, I would like to know how eliminate the caption bar menu for moving the dialog.
And also why moving the dialogs make my timer stops, and if I can avoid that stopping.
thank you in advance.
|
|
|
|
|
To remove the Move item from the system menu:
HMENU hmenu = GetSystemMenu ( hYourWindow, FALSE );
RemoveMenu ( hmenu, SC_MOVE, MF_BYCOMMAND );
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
If I don't mind that the value obtained would be the last introduced, can I access a variable that it's in a continuated change (X and Y coordinates in a machine) in order to show them?
I would like to know the fastest way, I'm doing a 2D simulation and I don't know if it would be correct to use pointers to the values and refreshing the draw area at some kind of time event without using critical sections or any other kind of thread sincronisation procedure.
Thank you very much, and please excuse my english, it's not my best quality.
|
|
|
|
|
You certainly can access variables from different threads without using sync objects, it's just not the recommended way.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
Hi Joan,
For variables of simple types this is not a problem, just read them in to
have their latest value. However if the vaiable happens to be a string or
a struct you might find that sometimes the variable has only been HALF
updated! This is the exact thing that thread-syncing is meant to fix.
I am unsure what happens with doubles and int64's are they are 8 bytes
(2 words) and I don't know if the instruction set (& compiler) can update
the variable in one cycle. (which is what makes it safe)
[Wow, that reads really badly - you thought your english was poor!]
Jules
|
|
|
|
|
Hi all,
I want to know if it is possible to draw some text on top of another object (in my case, it's an MCI movie player)
Thanks a lot.
|
|
|
|
|
Yes it is,
if you look in the platform sdk samples there is an MCI video editing example
which allows you to draw hotspots on the video. They draw the lines at the
same place you want to draw your text. I can't remember the example name,
but the example is there.
Stephen Kellett
|
|
|
|
|
Would anyone happen to know of any example code for CBT hooks? I've looked at MSDN and I was unable to find some examples.
|
|
|
|
|
My program works in the background and controls the foreground window, and it pops out a small dialog to tell the user what it is going to do, and then the dialog may disappear in a few seconds. What can I do to make the dialog to pop out without a focus on it? I mean, what can I do so that the focus won't turn to this small dialog even when it pops up?
Thank you!
|
|
|
|
|
Does anyone know of a good Xaudio tutorial or sample code that uses the library? Any help would be great.
Joshua
|
|
|
|
|
I have a large application that loads over 60 of my dlls. I'm trying to increase the load time of the app by re-basing where the dlls are initially put into memory. I think I can hard code the memory address in the dll's settings, or I can use the LoadLibrary function.
My first question is how do you put in the base address in the LoadLibrary function?
My second question is will re-basing all these large dlls really make a big difference in loadup time.
Thank you very much for your help.
|
|
|
|
|
You can test whether load times will decrease (I hope you meant decrease, not increase ) by putting your DLLs in one directory and running:
rebase -b 1000000 *.dll
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
Hi,
I use a Html Compile file (.chm) instead of hlp file in my Visual C++ 6.0 app.
To launch this file i have a button which call ShelExecute function like this :
ShellExecute(m_hWnd, "open","c:\\Myproject\\MyFile.chm", NULL, NULL, SW_SHOWNORMAL);
It work.
If i press F1 Key i want to launch my chm file, but Winhelp try to run
"c:\\Myproject\\MyFile.hlp". This file don't exist.
To avoid this i override CWinApp::winhelp event in order to use Html Help API instead of
Winhelp like this :
----------------------------------------------------------------------------------
#include "htmlhelp.h"
#pragma comment(lib,"htmlhelp.lib ")
void CNetSenderDlg::WinHelp(DWORD dwData, UINT nCmd)
{
// TODO: Add your specialized code here and/or call the base class
if (nCmd==HELP_CONTEXT)
HtmlHelp(m_hWnd,"c:\\Myproject\\MyFile.chm",HH_DISPLAY_TOPIC,0);
CDialog::WinHelp(dwData, nCmd);
}
----------------------------------------------------------------------------------
BUT IT DON'T WORK. My App try always to launch MyFile.hlp
Can anybody help me to solve this problem
Best regards
|
|
|
|
|
You might try overriding CWinApp::OnHelp.
You may have to change the afx message map entry in the App class from ON_COMMAND(ID_HELP, CWinApp::OnHelp) to ON_COMMAND(ID_HELP, OnHelp) .
|
|
|
|
|
Hi Folks,
I have an ATL COM Server(dll) with one simple object in it. On calling some method Meth() on that object, I want to display a wizard implemented with cpropertysheetex and cpropertypageex.
However when I call the cpropertysheetex::DoModal(), it fails to display. (Trace says 'Property Sheet Failed'). It looks like some problem with the parent window. (I have more or less used the Wizard97 example).
Please treat this as urgent!! I am stuck!!
Thanks,
Girish
|
|
|
|
|
Step thru DoModal() in the debugger until you see where the trace message is being printed. You should be able to tell from the immediately preceding code what exactly is failing.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
Hello
Am using MSMQ. I see that it uses UNICODE. I have to do a receive and i do not know how the data is being sent. All i know is i have to receive data in ANSI.
Can someon help me to convert a UNICODE string to ANSI. ( a wchar[] to unisgned char.
TIA.
Anil.
|
|
|
|
|
Can someon help me to convert a UNICODE string to ANSI. ( a wchar[] to unisgned char.
You want the WideCharToMultiByte() and MultiByteToWideChar() functions in the PSDK. The PSDK and MSDN documentation is pretty straightforward.
He was allying himself to science, for what was science but the absence of prejudice backed by the presence of money? --- Henry James, The Golden Bowl
|
|
|
|
|
Check out my Intro to COM article - I discuss methods for converting between ANSI and Unicode.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
Just what i needed....
Thank you.
Anil.
|
|
|
|
|
Hi Anil,
The funcitons mbstowcs and wcstombs are documented in MSDN and do exactly
the conversion you are asking about. However when you are implementing
a system that has both chars and wchars you find yourself doing conversions
all over the place just so you can do things like strcmp.
[And instancinting tempory string objects is even worse]
So try the follow code segment to give you the string functions you want.
You will be able to use the function safe_strncpy to copy from either wchar
to char, char to wchar, char to char and wchar to wchar!
I have found this particularly useful for gradually changing chars to wchars
in a project as the other version of the function automatically steps in.
One day I'll write it up to post to CodeProject.
Jules
--- Code begins here, sorry if the format gets broken along the way ----
** Change of plan - the message was too long!
The function header is
template<class s1,="" class="" s2="">
int safe_strncpy(S1* szDest, const S2* szSrc, unsigned int iLen);
template<class s1,="" class="" s2="">
int safe_strncmp(const S1* szA, const S2* szB, int iLen=-1);
template<class s1="">
int safe_strlen(const S1* szString);
template<class s1,="" class="" s2="">
const S1* safe_strstr(const S1* sz1, const S2* sz2);
and you just use either char or wchar to do the work.
Tell me if you are interested and I'll email the FULL template to you.
|
|
|
|
|
I have been using Visual C++ for my development. But two weeks ago, I found that my Visual C++ (MSDEV.EXE) could not be launched. It gaves me runtime error "Abnormal Program Termination for MSDEV.EXE". I have tried several times to uninstall and reinstall the program but to no avail.
I have even reformatted the harddisk, install the Win2000 Pro SP1 (previously I used NT4.0 SP4), then, install VS6.0. And the same error occurred when I start MSDEV.EXE. Others programs like VB or VID run smoothly.
When I install VS6 SP4, it gives me this error:
cannot load package 'devied' ....
Can anyone help me please
|
|
|
|
|
When you say you reformatted your hard disk, I assume you mean that you reformatted a second drive that had Visual Studio on it...
In that case you probably have mangled some sort of registry or system DLL... Sometimes thats hard to recover no matter how many service packs you install. I'd go to Microsoft and download their program regclean and give that a go and try reinstalling.
|
|
|
|