|
embeddesign wrote:
For example I am searching for a simple function that converts hex to binary...
Converting from base-16 to base-2 is a two-step process. First convert the base-16 number to base-10 using strtol() , and then convert that result to base-2 using itoa() . Something like:
char *pszBase16 = "23f06e41", *end;
long lBase10 = strtol(pszBase16, &end, 16);
char szBase2[64];
itoa(lBase10, szBase2, 2);
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
And when i compiled it, it is still looking for it. I removed all references of the class from all cpp's and header files and when I compile it's still looking for the class cpp. I've tried cleaning the project and closing .NET studio and reopening but it still insists in trying to compile that cpp, even though it no longer exists.
is there a way to fix this...what file is holding that information?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
You need to remove references from the project's .dsp file.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
This is in .NEt studio.....I'm not seeing a dsp file. I see tons in my VS6. Should .NET be creating one?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
This is in .NEt studio...
I was afraid you were going to say that. Unfortunately, I do not have an answer for that platform.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
It was in my vcproj file. Removed all references and that fixed the problem. Once again thanks.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Do you include the header file in other files?
|
|
|
|
|
I had, but I had already cleared them out. The problem was that the vcproj file was holding the file name that it was looking for. Once I cleared that out, it compiled fine.
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hi,
I have created an MDI MFC Appwizard Application,with base class as CFormView .
I have inserted property pages in the form view. I have placed a check box on the 1st propertypage.
Now I want to access the value of the check box in the form.cpp file.
So how can I access it?
Drushti
|
|
|
|
|
If the checkbox is a CButton object, just use the GetCheck() method.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a modal dialog doing lengthing processing, and if the parent window (Form/View app) loses focus, the Parent window is not repainted, and only the animation control on the dialog is repainted. I´ve tried to avoid this using sleep(0), but to no effect. Has anyone any ideas?
Thanks
phil
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
You can move the lengthy process to a different thread, perhaps.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
The problem is I´m working with a Access database using DAO (MFC derived classes), and that is not thread safe. All I am doing is importing values from different tables from one DB to another.Dependent on the size of the data to import, this can take many minutes. I´m having to use do..while loops and this is obviously very CPU intensive. I´ve introduced sleep(0), to break the CPU usage a bit, but still have problems with the Main application painting. I´ve tried using GetParent()->RedrawWindow() from the Modal dialog, and funny enough, in the debug version this works, but when I compile in release, the modal dialog and the Main window are repainted, as long as no other window/app gets the focus. When I change back to my app, so that it has focus, both modal dialog and main app window are just plain white, and when the modal dialog gets focus, the task manager insists that it is not responding, but if I let it run, the task completes successfully. I´m no expert(as you can probably tell), but this has really got me stumped!
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
Hello. I have many message boxes to write and think I need a class to do it because I need some extra features to them compared with standard message boxes. I would want to create a message box giving it a style to use but specify that all buttons are MFC CButton objects so that I can add features to the buttons like tooltips and other features.
I would write dialogs for each message box I use but if I need to change the size of text on any one message box I would have to have a different dialog for every message box with different text on it.
Help please!
|
|
|
|
|
Say you're calling CMyMessageBox to your MessageBox replacement; then, add with the wizard a CString member associated with the text field where the message is displayed, and modofy the ctor of CMyMessageBox so that it accepts a message and assigns it to that variable. Automatically you can have as many messages displayed as you want. You can add to your customization by letting the user select the type of message box (yes/no, accept/cancel, and so on), that's a little more dificult, but not much.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
i'm writing a small program to help me keep track of how my computer (at a remote location) is being used. My small app runs on the remote computer, and registers data every 10mins, one is how long the system has been idle. (or more precise, if it has been used the last 10 mins).
I also would like to register if the current session is a remote session (eg accessed with remote desktop), to see if i myself was accessing the computer at that point, or if some other person was using the computer locally.
Is there any api i can ask to find out if the computer is (currently) being accessed via remote desktop?
thanks
Thomas
|
|
|
|
|
The WTSRegisterSessionNotification function registers the specified window to receive session change notifications. >> So your app can know when the state has changed (a remote session joins or not?).
The WTSEnumerateSessions function retrieves a list of sessions on a specified terminal server. >> In case you are writing a service (they do not usually have windows).
The WTSGetActiveConsoleSessionId function retrieves the Terminal Services session currently attached to the physical console. The physical console is the monitor, keyboard, and mouse. Note that it is not necessary that Terminal Services be running for this function to succeed. >> To distinguish if the 'current' session is remote or not.
The WTSQuerySessionInformation function retrieves session information for the specified session on the specified terminal server. It can be used to query session information on local and remote terminal servers. >> You can find out if session is rmeote or not, and all sorts of other infromation you might want to track.
|
|
|
|
|
I am trying to monitor when a paticular process starts up.
The way I am doing it now:
I used SetTimer() to call ON_TIMER
in OnTimer() I enumerate all running process and check to see if the app I am looking for is running. If it is I create a process handle to it and call KillTimer(TimerHandle) to stop the timer messages.
Problem:
Even though I call KillTimer() I still get OM_TIMER messages and can't stop the check for the running process. Just wondering if anybody nows a better way to continually poll for running processes or if anybody knows why the call to KillTimer isn't working.
Thanks in advance.
|
|
|
|
|
Hello,
I was wondering if any of you CPers know how to solve this problem i've come across with.
I've defined about four or so methods in this class of mine as inline and, it appears, the linker cannot find the method's definitions in the .OBJ .
The only way of solving this issue is by NOT defining the method(s) as inline . How do I do about solving this, while at the same time keeping inline declaration?
Thanks a lot
David
Linker Error:
Linking...
LINK : LNK6004: Debug/xtest.exe not found or not built by the last incremental link; performing full link
xtestDlg.obj : error LNK2001: unresolved external symbol "public: char const & __thiscall XField::GetText(void)" (?GetText@XField@@QAEABDXZ)
Debug/xtest.exe : fatal error LNK1120: 1 unresolved externals
|
|
|
|
|
inline methods must come in headers. Are you by chance defining the method in some .cpp instead?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
Yes, that is true.
I have defined it in the class declaration - in the header file - and I've coded the method(s) in the actual source file (.cpp ) .
I take it you mean I can't insert the code in the source file but only in the header?
David
BTW, thanks for the reply
|
|
|
|
|
Hi guys
Somebody knows what's the fast way to generate a random (or pseudorandom) array of numbers of 100.000 positions?
Thanks in advance
Doc
|
|
|
|
|
Are you wanting 100,000 numbers, or are you wanting numbers with 100,000 digits?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I want a list of 100.000 numbers randomly sorted.
Doc
|
|
|
|
|
doctorpi wrote:
I want a list...
But the subject indicates an array. I'll show an example for an array.
int nNumbers[100000];
for (int x = 0; x < sizeof(nNumbers) / sizeof(int); x++)
nNumbers[x] = rand();
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|