|
That's awesome thanks.
|
|
|
|
|
Hello,
I am trying to create a new dialog with a text box that accepts string values from my main dialog's program. In other words, once a button is pushed on my main dialog, a new dialog appears with a text box - i would like to send strings from my main dialog program to the new dialog's text box. I am using CCancelBox dlg; and dlg.DoModal(); to bring up my new dialog once the button is pushed, but I don’t know how to link the text box to my main dialog .cpp program. Thanks a million in advance.
~Loren.
|
|
|
|
|
The second dialog will need a member variable that the main dialog sets. Then in the second dialog's OnInitDialog() method, set the control's value to that of the member variable.
CmainDlg::Foo()
{
C2ndDialog dlg;
dlg.m_somevar = "Text!";
dlg.DoModal();
}
C2ndDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_control.SetWindowText(m_somevar);
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
i have met some problems when i try to write the matlab c++ programming.
after i finished my program and tried to compile in MSVC++ 6.0
.......
LINK : fatal error LNK1104: cannot open file "msvcirt.dll"
what should i do to settle this linking problem?
thank you for ur all helping
vincent sim
|
|
|
|
|
Vincent Sim wrote:
what should i do to settle this linking problem?
Check to ensure the file exists and that it is accessible by the linker.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The problem that I am having is with regards to compiling the RTF files after I have made changes to them.
All I did was open the AfxCore.rtf file and replace the <<YourApp>> callouts with MyApps Name.
I used Microsoft Word 97 and saved the files back as RTF.
I then opened up Help Workshop and compiled the files.
I got numerous errors and the HLP file was not created.
Anyone else have this problem?
|
|
|
|
|
Personally, I have always avoided using Word etc to edit the .rtf files. You will find that editing them in a tool such as notepad or Visual studio (as text) will allow you much better control.
Also this article may be of help if you do follow this route: Simplified AfxCore and AfxPrint.rtf files[^]
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
I have a function that looks like
Process(string str1 , string str2)<br />
{<br />
string concat ;<br />
concat = str1+":"+str2;<br />
ProcessFurther(concat);<br />
}
str1 and str2 passed are strings but represent numbers. Is there a way i can do a type checking to find if its a valid number .
I am looking for something like isNumber() functionality as i need to make sure that what is passed is surely a valid integer and not a garbage string which might have catastrophic results !
Please advise
|
|
|
|
|
you could use strtol() to convert the string to an integer, and then make sure the endptr actually points to the end of the string.
bool IsNumber(std::string str, int base)
{
char *EndPtr = NULL;
const char *Number = str.c_str();
strtol(Number, &EndPtr, base);
return (EndPtr != Number && *EndPtr == NULL);
}
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
how can i differentiate between a conversion for the string "0" or a failed conversion ?
Engineering is the effort !
|
|
|
|
|
The routine I gave you does that.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
sorry didnt see this
return (EndPtr != Number && *EndPtr == NULL);
|
|
|
|
|
Alternative approach:
bool isNumber(const char* s)
{
int junk;
return(sscanf(s, "%d", &junk) ==1);
};
|
|
|
|
|
won't work properly. pass in "21@#$" and your function will return true.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Good point, modify as follows:
bool isNumeric(const char * s)
{
int junk1, junk2;
// Check for a number and check that nothing follows the number
return (sscanf(s, "%d%c", &junk1, &junk2) == 1);
}
Reuse is a wonderful thing.
|
|
|
|
|
Hi Everyone!
How can i filter packets and analyse them ?
I had already searched in Google but the only things i found
was a complete sdk which costs 1900 €. I don't think i need
the sdk to capture packets. Maybe someone of you can write an
article about this topic. I think it is an interesting thema.
mfg
RedDragon2k
|
|
|
|
|
|
Thx.
|
|
|
|
|
Hi,
I want to check from my SDI application if a particular file is opened by the user, and if opened I want to close that file.
How do I do that?
Please advise
|
|
|
|
|
Basically, I believe there would be two types of approaches to this problem:
1. Hook the file system to send notifications when a file is accessed
2. Hook a system event to give you a notification each time a file is opened.
3. Use the standard file commands to prohibit access
The first method is by far the most troublesome and difficult, but will provide the most accurate, functioning results. You would need a low level access to the NTFS file system and be able to enumerate through currently open files. If the desired file is found in this enumeration, it is closed.
The second method relies on the Windows OS to give you a notification when a file system event occurs. The most effective way to accomplish this would be to use some IFS element. IFS (Installable File System) is part of the Windows DDK and allows you to build file system filter drivers, which can capture different events. FileMon is one example from this type of application.
The final option is the most easiest: when your application is started, you open the file in a non-exclusive mode, which means that all other attempts to access this file while your application has it open will fail. However, this means that only your application can access the file in question, and this approach will cause a system crash if used on critical system files. But for protecting application-specific files, this is the most effective one. For an example, see this article[^]
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I have been given a bit of source code which I am trying
to compile!
The code uses the functions
SetupDiGetClassDevs( ... )
SetupDiEnumDeviceInterfaces( ... )
which are in setupapi.lib
Unfortunately I get the error messages
error C2664: 'SetupDiGetClassDevsA' : cannot convert
parameter 1 from 'const struct _GUID *' to 'struct _GUID *'
looking at my .h files I see that param 1 takes a 'struct
_GUID' but in the msdn site it takes 'const struct _GUID'
I am led to believe my sdk is out of date!!
does anyone know where I can find the updates, I have
looked everywhere
I have already installed SP5
thank everyone and have a goog christmas
bob
|
|
|
|
|
|
Hi
I have the following warning when i link. (I can execute program perfectly though)
Programm1.exp : warning LNK4070: /OUT:PROGRAMM2.EXE directive in .EXP differs from output filename "C:\vss\MyProject\Debug\Programm1.exe"; ignoring directive
Any idea what this means?
Best regards
Jens
|
|
|
|
|
Per MSDN:
The filename specified in the NAME or LIBRARY statement when the .EXP file was created differs from the output filename that was either assumed by default or specified with the /OUT option.
A client program that uses the resulting DLL might encounter problems.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hm, could it be that you export some functions via a .def file?
Then check its first line - it should read as: LIBRARY PROGRAMM1.EXE
RK
|
|
|
|