|
Try this
WinExec("c:\\Bonus.exe",1);
m0n0
|
|
|
|
|
I couldn't find an appropriate forum ;o)
Does anyone know if it is possible to write a macro in DevStudio to open the build directory of the executable/dll/lib that you've just built?
On a per configuration basis?
I'm forever having to browse for those directories and it seems like such a simple thing...but I've looked at the macro help and the DevStudio objects and I can't see anything likely ...
Cheers,
Dan
|
|
|
|
|
hello friends
i am making a project on intrusion detection system in which i m using genetic algorithm and want some guidance in genetic algorithm.
thanx
bye
|
|
|
|
|
I'd suggest you use the fork() function.
Chris Meech
I am Canadian. [heard in a local bar]
Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
There are some places on the web for genetic algorithms, e.g http://lancet.mit.edu/ga. I suggest reading a book of David Goldberg about GA.
|
|
|
|
|
I defined the variable as
CCriticalSection m_sync;
and used the variable m_sync as
m_sync.Lock();
...
m_sync.Unlock();
but there were the errors as follows:
C:\Documents and Settings\ACER\桌面\wzy1\wzy1View.cpp(20) : error C2146: syntax error : missing ';' before identifier 'm_Sync'
C:\Documents and Settings\ACER\桌面\wzy1\wzy1View.cpp(20) : error C2501: 'CCriticalSection' : missing storage-class or type specifiers
C:\Documents and Settings\ACER\桌面\wzy1\wzy1View.cpp(20) : fatal error C1004: unexpected end of file found
Generating Code...
Error executing cl.exe.
Why is that?
I am rather confused!
Thank you!
|
|
|
|
|
Did you include afxmt.h ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
You might also want to look at using InitializeCriticalSection(), EnterCriticalSection(), and LeaveCriticalSection()
|
|
|
|
|
Hi all,
I am struggling trying to write a function that will take a hex, octal or binary number as a string, and then convert it to an integer, and return that as a string.
The catch?
The value is going to be substatially bigger than INT_MAX. Unfortunatly to meet my needs, this is also going to have to be a static function(s), so no new classes with overloaded operators.
Any ideas?
Cheers,
MadFruit
|
|
|
|
|
Have you looked into strtoul() ? For example:
unsigned long ulNumber;
char *endptr;
ulNumber = strtoul("0x123", &endptr, 16);
ulNumber = strtoul("110100111", &endptr, 2);
ulNumber = strtoul("1053", &endptr, 8);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Unfortunatly, and unsigned long, is not likely to be large enough. The binary values that I will potentailly have to handle could have N bits. Existing types are not going to help much I think.
The route I believe I have to take is to try and cut the numbers down to handlable, convertable sizes, and then somehow add them together. But I am not really sure.
|
|
|
|
|
I am working on similar project, and i have written four functions :
CString Add(CString s1,CString s2)
CString Sub(CString s1,CString s2)
CString Multiply(CString s1,CString s2)
CString Divide(CString s1,CString s2)
which as you see return CString values .
and finally converting to any other base is no more a problem ,
using these functions you can convert to binary any number,using simple algorithm dividing by 2 (16 if Hex and 8 if Oct) ,,,,.
But my problem is that it takes too long to convert for example 500 digit number to binary.
So i think you'll also have to write smth .similar to these functions first and then think of converting from one base to another
Good Luck!
m0n0
|
|
|
|
|
Hi All...
This question has gotta be really simple... I'm trying to read 8 characters from stdin. So if the user types 1233456789abcdef<enter>, my string buffer (of size 9) gets filled with "12345678\0". If the user just hits enter, then I want the string to just get "\0" in it. Sounds simple right?
I've tried using
char text[9];
memset(text, 0, sizeof(text);
scanf("%8s", text); Which works fine, except if you want to enter blank - just hitting enter, scanf won't stop scanning until you type something, and then hit enter.
Next I tried using fgets. Which works better in this respect:
char text[9];
memset(text, 0, sizeof(text);
fgets(text, 9, stdin); So if you just hit enter, then all that ends up in text is "\0". Fine. But if the user types 123456789abcdef<enter>, then "12345678" gets transfered into text , but the remaining charachters "9abcdef" seem to linger in stdin, so if you call scanf, or fgets immediatly afterwards e.g. for a second parameter input, the function sees this input, rather than asking for some fresh input (which is what I want) - even though they're just spurious charachters that I don't care about! So is there a better way of doing this? possibly a way of discarding the spurious characters.
[EDIT]Putting fseek(stdin, 0, SEEK_END); between my fseek s and scanf s seems to help. Is this a good way of doing it?[/EDIT]
Joel Holdsworth
Wanna give me a job this summer?
Check out my online CV and project history[^]
|
|
|
|
|
|
Have you considered using _getche() ? That way you can control exactly how many characters, and which ones, are entered.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi all!
I've a dialog, in the function : DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_BMP_NEW, test);<br />
in OnInitDialog():
DWORD dwStyle = WS_VISIBLE|SS_BITMAP|SS_NOTIFY;<br />
cRect.SetRect( 0, 0, 17, 15 );<br />
m_csNew.Create(NULL, dwStyle, cRect, this, IDC_BMP_NEW);
m_bmp.LoadBitmap(IDR_BMP_NEW1);
m_csNew.SetBitmap(HBITMAP(m_bmp));
.h file :
CRect cRect;<br />
CStatic m_csNew;<br />
CBitmap m_bmp;<br />
CMyClass test;
anf, finally, i get a error when i compile :
Debug Assertion Failed!
...
File : wincore.cpp
Line : 312
Do u see my pb?? Help me
PS: when i delete DDX_Control(pDX, IDC_BMP_NEW, test);
--> it's OK, but i have any actions!
I think, we have to declare m_csNew.Create(...) before DoDataExchange , but i don't know how to do it
|
|
|
|
|
thanh-hai.bui wrote:
i get a error when i compile :
Debug Assertion Failed!
Assertions happen at run-time not compile-time.
thanh-hai.bui wrote:
File : wincore.cpp
Line : 312
Have you set a breakpoint on line 312 of wincore.cpp?
thanh-hai.bui wrote:
PS: when i delete DDX_Control(pDX, IDC_BMP_NEW, test);
--> it's OK, but i have any actions!
From the code snippet you've provided, two CStatic variables (m_csNew and test ) are being mixed. If you already have a static control as part of the dialog template (test ), why are you creating another at run-time (m_csNew )?
Unless you are bent on using a static control to display the image, why not just use a picture control. It's much easier and doesn't require any code.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi,
i am learning c code, and i am looking for a function 2 calculate the short way in a map, does anyone have such function, thx
|
|
|
|
|
isn't the shortest way between two points the line ?
;P
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I think we were thinking the same thing
|
|
|
|
|
yep,i mean there are lotz of points, find the shortest way bewteen 2 points
|
|
|
|
|
I think this will depend a lot of how your map is implemented. You know, if I had to respond to your question like it is asked, the response is simple: it's the straigh line !! But I suppose it's not the solution you want to hear isn't it ? So try to be a little bit more precise...
You can also look for the A* pathfinding algorithm (a google search gave me these links[^]
Maybe it will be helpfull...
|
|
|
|
|
first of all, i am using dos
second , there a lot of points, there r different distance bewteen 2 points, and i need a function 2 calculate the shortest path bewteen 2 given points
|
|
|
|
|
THX FOR THE HELP!!!!!!!;);););););););););)
|
|
|
|
|
BY THE WAY, DO U HAVE THE SOURCE CODE FOR C OR C++, THX
|
|
|
|
|