|
Try
csharpClass->Text = d->ToString();
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
You fell into the trap. I was about say something like that , later realized "Text" is of type double too.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Ah - should read the original post more thoroughly.
I should have gone with my stock 'Managed C++' answer - you're posting in wrong forum - get outta here!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: I should have gone with my stock 'Managed C++' answer - you're posting in wrong forum - get outta here!
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Hi,
Thanks in advance
how can i link multiple shared libraries o.s linux
Appreciate help
Thanks
al
|
|
|
|
|
#pragma comment(lib,"your_first_lib")
#pragma comment(lib,"your_second_lib")
I don't know if it's valid in your compiler. You can also ask it Here[^]. Haunted though
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
what about 'man g++' ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In general, Linux libraries have names of the fgorm libname .
What yopu need to do is a) set the environment variable LIBRARY_PATH to include the directory you want (e.g. export LIBRARY_PATH = /usr/local/lib:$LIBRARY_PATH and b) add option -llibrary-name to your gcc or g++ comamnd-line. Simple as.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hello all,
I really must be missing something here, as all my attempts to terminate explorer.exe all end up with it restarting. I am calling TerminateProcess on explorer.exe, and the call IS working. However, explorer.exe just ends up starting up again.
But when I terminate explorer.exe from taskmgr, it doesn't restart.
Why is this happening? And how can I prevent the restarting?
Thanks in advance.
|
|
|
|
|
Um...Just for the record, terminating explorer.exe is generally not a good thing. And keeping it from restarting is even worse!
explorer.exe is basically the user-interface part of Windows. If it is terminated, it will keep the end user from using the taskbar and desktop icons while ticking him/her off. And if it doesn't restart, the end-user will have to manually start it again.
That being said, I will now try and answer your question.
Windows is programmed to restart explorer.exe when it is terminated by any means other than shutting down. If anyone knows how to keep it from restarting, I highly doubt that they will tell you. Leave explorer.exe to Microsoft.
Come on! Get down with the sickness! - Disturbed
|
|
|
|
|
I know very well what I am doing by terminating explorer.exe, and I can assure you I have a good enough reason to be doing it.
Kenny McKee wrote: Windows is programmed to restart explorer.exe when it is terminated by any means other than shutting down.
How exactly does taskmgr manage to kill explorer?
|
|
|
|
|
It appears as though the required functions to do this are part of the OS, and can't be used based on this forum[^]. That is what I gather anyway.
I didn't mean to make it appear as though I was insulting your intelligence. I just wanted to be sure that you knew the dangers.
How many bytes of text have I typed in my lifetime??? Man, I wish I kept track...
|
|
|
|
|
Oh it's alright. I expected some suspicion anyways
I read an article a few minutes ago on cleanly shutting down explorer.
The way to tell Explorer to shut down is to say you want to shutdown the machine, but then cancel in a special way:
Start->Shutdown->CTRL+ALT+SHIFT+Cancel
If I were to monitor explorer.exe, would I be able to see the function calls that do this?
EDIT: I don't think I can. explorer just ends itself like any other app.
New question: Would it be possible to inject something into explorer and call ExitProcess(0) within the process?
Thanks a lot for your help
modified on Monday, March 16, 2009 2:56 PM
|
|
|
|
|
The forum that I gave you the link to seems to say something about replacing explorer.exe, but I haven't went very in depth with that and it sounds like it might cause quite a few problems.
How many bytes of text have I typed in my lifetime??? Man, I wish I kept track...
|
|
|
|
|
First TerminateProcess is not good way for close a program why?
MSDN:
All object handles opened by the process are closed.
All threads in the process terminate their execution.
The state of the process object becomes signaled, satisfying threads waiting for the process to terminate.
The states of all threads of the process become signaled, satisfying threads waiting for the threads to terminate.
The termination status of the process changes from STILL_ACTIVE to the exit value of the process.
Terminating a process does not necessarily remove the process object from the system.
A process object is deleted when the last handle to the process is closed.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Thanks for your reply Hamid.
I can assure you that TerminateProcess will be my last resort in attempting to kill explorer
The thing is, I don't want to send a WM_CLOSE message to explorer.exe, as that brings up the Windows shutdown prompt. Is there any other way I can exit explorer.exe, excluding "tskill explorer"?
|
|
|
|
|
Sample input string
james 35 bond 30
berry 40 bond 37
The program must separte each line into 4 parts. first name, age, last name, and age+7, the following code is a sample of with only 2 component, I don't know how to do it with 4 components. Could someone edit the code for me please.
[CODE]void main(int argc, char *argv[])
{
struct person list[];
int i,n;
char *ch, *ch1;
char buf[256];
FILE *file1;
i=0;
fgets(buf,250,file1);
while(!feof(file1))
{
ch=strchr(buf,'\n');
if (ch!=NULL) *ch='\0';
else break;
ch = strchr(buf, ' ');
if(ch!=NULL)
{
*ch='\0';
ch1=++ch; //age
}
else break;
strcpy(list[i].lastname,buf);
list[i].age=atoi(ch1);
i++;
fgets(buf,256,file1);
}
n=i;
for(i=0;i<n;i++)
printf("%s is %d years, first name is %s\n", list[i].lastname, list[i].age);
}[/CODE]
|
|
|
|
|
Happy using C++ and STL? Then this should do you:
#include <sstream>
#include <iostream>
#include <fstream>
#include <string>
int main(int argc, char** argv)
{
std::ifstream f(argv[1]);
while (f)
{
std::string firstName, lastName;
int age1, age2;
f >> firstName >> age1 >> lastName >> age2;
if (!f) break;
std::cout << firstName << std::endl;
std::cout << lastName << std::endl;
std::cout << age1 << std::endl;
std::cout << age2 << std::endl;
}
}
This does require that your file has the right format - if you need to check the format, then I'd use a regex library, like Boost.Regex or the TR1 library included in VS2008. If you use one of those, this code works:
#include <sstream>
#include <iostream>
#include <fstream>
#include <string>
#include <boost/regex.hpp>
int main(int argc, char** argv)
{
std::ifstream f(argv[1]);
while (f)
{
std::string line;
std::getline(f, line);
boost::regex sreLine("^(\\S+)\\s+(\\d+)\\s+(\\S+)\\s+(\\d+)\\s*$");
boost::smatch match;
if (boost::regex_match(line, match, sreLine))
{
std::cout << match[1] << ' ' << match[2] << ' '
<< match[3] << ' ' << match[4] << std::endl;
}
else
{
std::cerr << "Line \"" << line << "\" doesn\'t match\n";
}
}
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
sorry, but I'm seekiing for a answer using C only.
|
|
|
|
|
You want to make life difficult for yourself, eh
How about using strtok, then:
char line[] = "james 30 may 40";
for (char* phrase = strtok(line, " ");
phrase;
phrase = strtok(NULL, " "))
{
printf("%s\n", phrase);
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Using straight C, you're on the right path; compile and debug it (though I can already see a problem with how do you the loop with fgets/feof. As an alternative to your manual parsing, use strtok (you could also play around with sscanf/fscanf.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
hello,
is there an easy way to put a CDialogBar on a CDialog ?
Thankyou very much.
|
|
|
|
|
found it -> RepositionBars
|
|
|
|
|
simple c++ questions
Hi what is that?!
TCHAR *pos;
pos = _tcsstr(key, _T("\"%1\""));
??
and
dc.FillRect(rectArea.operator LPRECT(),&m_brBckColor);
how is that
and
NewButtonRect -= CSize(ButtonRect.right - point.x + m_nJumpDistance, 0);
what does this mean?
if one can delete this post and answer me in private i think the questions are so simple I,am confused
ty
|
|
|
|