|
Thank you for quick answer.
I did it and got compiler error:
error C2440: 'return': 'ATL::CSimpleStringT<basetype,t_bmfcdll>::PCXSTR' kann nicht in 'char *' konvertiert werden
Try to translate:
error C2440: 'return': 'ATL::CSimpleStringT<basetype,t_bmfcdll>::PCXSTR' can not be convertete to 'char *'
What now?
|
|
|
|
|
But with
const char* GetCommand(void) {
return (LPCTSTR)this->m_sCommand;
}
it is working. Now I have tr test, where to change on other places.
|
|
|
|
|
yes, i didn't mentionned that the LPCTSTR type was a typedef of the const char* one.
sorry for my mistake.
TOXCCT >>> GEII power
|
|
|
|
|
You are taking the address of an instance of a CString and casting it to a char*. That will not work as you have discovered. If you use 'toxcct' response you should find that may work fine. What that response does is use CString's ability to convert itself to a char*. However the pointer you are given is a const pointer and you are then casting away the const'ness. As long as you do not try to change the buffer contents that the pointer points to, you will be fine. But if you need non-const access, you will need to code this differently. Probably through some kind of Set method.
Chris Meech
I am Canadian. [heard in a local bar]
I think people should be required to have an operator's permit to use the internet. John Simmons
I have a feeling that if the millions of man hours wasted every year by geeks trying to get various video and sound cards working under Linux were put into some useful endeavor we'd have solved world hunger, we'd have peace and aids would be no more. [JOS poster]
|
|
|
|
|
what about sprintf()?
[insert witty comment here]
bdiamond
|
|
|
|
|
You should copy the data to buffer either supplied in the argument list or to a global buffer if you are not planning on doing anything extreme with it.
|
|
|
|
|
Which is better from overall performance point of view - Creating a shared memory (~100MB) on the paging file, or on a separate disk file?
Thanks,
Krishnan
|
|
|
|
|
There is a key in the registry
UninstallString which contains a Path such as
C:\WINDOWS\system32\UNWISE.EXE C:\WINDOWS\system32\myodbc3_install.LOG
or
rundll32.exe setupapi.dll,InstallHinfSection DefaultUninstall 132 C:\WINDOWS\INF\PCHealth.inf How do i check that these Paths exists and the uninstall entry in the registry is good.
Parsing it seems to be a real pain
Is there a way by which i can ask windows that or i am stuck with writing a BIG BUGGY parsing algo cause there are tons of different types of entries
any help or suggestion will be welcomed
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
http://www.mastishk.com
|
|
|
|
|
mailMonty wrote:
How do i check that these Paths exists...
Do you mean with something like _access() ? If not, please explain the problem further as I do not understand exactly what the goal is.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
always so concise in your answers dear David... i appreciate ! ;)
TOXCCT >>> GEII power
|
|
|
|
|
As Steven Covey says:
"Seek first to understand, then to be understood."
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
How do I initilaize an array whose size will be determined by an user input(For example from a edit box ?
I tried this but they didnt work...
numsamples = m_numsamp;
const long arr = numsamples;
ULONG x[arr];
ULONG y[arr];
They returned error 2057 and 2466.
Thanks!
Deepak Samuel.
|
|
|
|
|
You need to dynamically allocate your array. This is where pointers comes very handy!
ULONG* arrA = NULL;
int nSize;
<font color=green>
..
<font color=green>
arrA = new ULONG[nSize];
if(NULL != arrA)
{
<font color=green>
arrA[0] = 1234;
cout << _T("yeah baby!") << arrA[0] << endl;
<font color=green>
delete [] arrA;
{
I Dream of Absolute Zero
|
|
|
|
|
Hello,
Does anybody know if you can 'disable' the beep when calling an AfxMessageBox? This is quite annoying.
tnx!!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I don't think you can switch it off programmatically from the ::MessageBox() function.
Have a look in your Control Panel, under 'Sounds, Speech, and Audio Devices'. You can control the WAV associated with a windows event, including the message box sound(Default Beep). You can even choose to switch it off from there.
I Dream of Absolute Zero
|
|
|
|
|
I have an application which starts another application, but I dont need to see the dialog window of this other program. The user can maximise it if required.
I have tried the following to hide the dialog window in the program:-
this->OnShowWindow (FALSE, 0);
<br />
and this->ShowWindow (SW_HIDE);
but the dialog wind is still visable.
I start the program via CreateProcess (see below):-
::ZeroMemory(&si[0], sizeofsi[0])); <br />
GetStartupInfo(&si[0]);<br />
si[0].dwX = 0;<br />
si[0].dwY = 0;<br />
si[0].dwFlags = STARTF_USEPOSITION;<br />
CreateProcess( NULL, <br />
"c:\\Program Files\\Joystick\\MSCPP.exe",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si[0],
&pi[0]);
Any comments please as I am sure a simple solution exists.
|
|
|
|
|
Just change your startup information:
sweep123 wrote:
si[0].dwFlags = STARTF_USEPOSITION;
Try this:
si[0].dwFlags = STARTF_USEPOSITION | STARTF_USESHOWWINDOW;<br />
si[0].wShowWindow = SW_MINIMIZE;
cheers,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proff programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
Thanks, but no luck.
The program window is NOT minimised.
|
|
|
|
|
try ShellExecute
Last parameter set it to SW_HIDE
or ShellExecuteEx
or LoadModule()
gabby
|
|
|
|
|
Does the dialog have a minimise button? If it doesn't, you can't minimise it.
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...
I need to run an external program, suspend at some offset, retrieve register values(like ebx) and continue running external app.
That is the problem
How do run-time patchers work?
P.S.: Please reply to ths@smtp.ru
Thanks...
|
|
|
|
|
Hi Guys,
I'm sure this is a very easy question, but i'm damned if i can find the answer. I've just started using VS.NET instead of VC6- but still for unmanaged, MFC development.
In VC6, I could very simply use classwizard to create an override of CDialog::OnInitDialog, and have VC6 generate a stub function for me (which called the base class implementation).
How do you do this is Visual C++ .NET ? Surely there must be a way.
Thanks
Jon
#include <beer.h>
|
|
|
|
|
In the class view select the appropriate class that you want to add the handler for. In the properties window, click on the overrides button (little green boxy looking icon). Scroll down to onInitDialog, click in the right hand column, click on the drop down box, select on '<<add>> OnInitDialog', the code should have been added.
You add WM_* event handlers in the same way, except you click on the messages button first.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Wow, thankyou. Bizarrely, i'd not noticed the Overrides and Messages buttons!. I expected there to be either a mechanism for overrides on the Add Method dialog, or maybe something on the context menu you get when right clicking a method in the base class. But no.
Thanks
Jon
#include <beer.h>
|
|
|
|
|
Hi,
Is there a way of sending character keys to other apps (eg Notepad)?
Currently I can get the hwnd for the notepad window, and I can close it down by do ::PostMessage (hwnd, WM_QUIT, 0, 0) . Thus I know I have the correct hwnd. However when I send WM_CHAR no characters appear. Any ideas?
Also, is it possible to post keys that correspond with menu items (eg 'ALT-F' (for file) then 'S' (for save))?
cheers,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proff programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|