|
Thanks, Joaquín buddy!
George
|
|
|
|
|
can somebody help in finding out,how to display a number in local currency format? Is there any function that converts a nuber into the local currency?
|
|
|
|
|
GetCurrencyFormat() is what you are after.
|
|
|
|
|
hi there,
i've made an IE toolbar with several custom drawn buttons
the buttons are made with a blank icon, and then i override the drawing using the custom draw notification.
Everything works fine when IE is maximized, but when i start scaling down the IE, the behaviour is as follows:
-those icons on the far right which are found to be with separators, will start to be clipped away.E.g. between 2 separators there are 4 icons. As soon as the last icon, is partially hidden, all 4 buttons are clipped away
-when a certain amount of pixels of the toolbar are hidden, this weird clipping doesn't occur anymore on the remaining buttons. I confirmed this since if i make big indent for the start of the buttons (say 300 pixels), the strange behaviour of clipping away buttons will manifest itself at the same point.
any ideas?? this is freaking me out
cheers
nev
|
|
|
|
|
i fixed YAAAAAAAAAAAAY
just had to turn off TBSTYLE_WRAPABLE
|
|
|
|
|
Anybody knows about DDI Hooking?
vikramS
|
|
|
|
|
|
thanx for the suggestion But I went thr those links before ..looking for more help
|
|
|
|
|
Hi, everyone!
I am reading the source codes of another buddie and
I often see strange operation with "this" pointer.
It really makes puzzled. Here are two cases,
Sample 1:
--------
class A {
public:
memberFunction(const A& a)
{
*this = a;
}
};
int main()
{
A a;
A b;
a.memberFunction(b);
return 1;
}
--------
I think in the first case, the statement "*this = a" calls the
class default assignment operator,
--------
void A::opeartor = (const A&).
--------
Am I correct?
Sample 2:
--------
class A {
public:
void memberFunction(A* a)
{
this = a;
}
};
int main()
{
A a;
A b;
a.memberFunction(&b);
return 1;
}
--------
I think in the latter case, the statement "this = a" is not correct since
the value of this pointer can not be modified. But I am not sure about
it. Am I also correct?
Thanks in advance,
George
|
|
|
|
|
Assigning a value to this is illegal, so your example 2 will not compile.
By the way, the word is spelled "buddy"
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Thanks, Michael buddie!
Is my options correct in example one?
regards,
George
|
|
|
|
|
Yes, the compiler will try to generate an assignment operator if you do not write one yourself. If the class contains members which are themselves classes, this may not end up doing what you want, so when in doubt it's best to write the assignment operator and copy constructor.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Thanks, Michael buddy!
George
|
|
|
|
|
Hi, everyone!
In the following sample,
--------
class A {
};
int main()
{
A a;
}
--------
I think variable "a" is allocated on function stack and
not on app heap. So there does not exist memory leak.
It is different from the following case, when memory
is allocated on app heap, which needs to be deleted.
Am I correct?
Next example,
--------
class A {
};
int main()
{
A* a = new A();
delete a;
}
--------
Thanks in advance,
George
|
|
|
|
|
|
Thanks, Dave buddie!
George
|
|
|
|
|
Heyas all...
I am comming from a Linuc programming background and I'm trying to port a small program to Win32. It's going to be a console app and I have 2 questions on it. Before I go any further I am going to post my program:
#include "iostream.h"
int main(void){
int i;
cout<<"\n\t\t CoxEdgeLauncher Version .98\n";
cout<<"\t\t(c)2003 Digitally Khaotic Solutions, Inc.\n";
cout<<"\nInitializing CoxEdge";
for(i=0;i<5;i++){
cout<<"."<<flush;
sleep(1)
}
cout<<"\nCalibrating delay loop";
for(i=0;i<6;i++){
cout<<"."<<flush;
sleep(1);
}
cout<<"\nLaunching CoxEdge..."<<flush;
sleep(3);
cout<<"\n\n***App Started. This line and DOS box will disappear***\n\n";
return(1);
}
Now, I know I'm missing some headers in there and that's my first question. What header would include a sleep or sleep like function in Win32? On my Linux box I'd use unistd.h but it doesn't seem to exist on Windows. The second question is, how do I call an external program from within my code? i.e. I want notepad to startup right after "Launching CoxEdge..." is displayed.
I'd appreciate any info anyone can provide for me.
Thanks in advance.
Digital Khaos
"Diplomacy is dead. Feel my wrath!"
|
|
|
|
|
You want Sleep() with a capital S. It lives in windows.h
system() should be enough to launch Notepad. Otherwise look at ShellExecute().
Software is everything. It also sucks. Charles Fishman [^]
Awasu 1.0.3 (beta)[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Taka I appreciate the quick response. The Sleep() function is working prefectly thank you. I am having a bit of a time trying to figure out ShellExecute() though. I have the following:
ShellExecute(NULL, "open", "c:\windows\notepad", NULL, NULL, SW_SHOWNORMAL);
Now, if I make it:
ShellExecute(NULL, "open", "notepad", NULL, NULL, SW_SHOWNORMAL);
It works. I guess my question is how do I specify a path? For the final outcome the path to the program is "s:\CoxEdge\coxedge.exe". When I put in full paths, I get warnings aluding to unrecognized escape characters.
Any thoughts?
Again I appreciate it.
Digital Khaos
"Diplomacy is dead. Feel my wrath!"
|
|
|
|
|
the slashes in your string are being interpreted as escape characters \w and \n respectively.
use \\ to escape slash characters i.e. "c:\\windows\\notepad"
Software is everything. It also sucks. Charles Fishman [^]
Awasu 1.0.3 (beta)[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Welcome to Windows, John.
Two points - the argument to Sleep() is milliseconds. I assume you mean to sleep for 1 second, so use Sleep(1000) .
Second, check out the VC forum FAQ[^] which includes a FAQ on launching other programs.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Since you are building a console application you should use the function:
#include <process.h>
or
#include <stdlib.h>
int system( const char *command );
And if you really insist on using something else, and you don't understand ShellExecute, then go with
WinExec( "Application.exe", SW_SHOW );
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
I have a class ...
<br />
<br />
class blah {<br />
...<br />
public:<br />
...<br />
double buffer[100][100];<br />
...<br />
};<br />
Now in another class I do this ...
<br />
<br />
anotherClass::anotherClass () {<br />
...<br />
for( int i=0; i<100; i++ ) {<br />
for( int j=0; j<100; j++ ) {<br />
p2_blah->buffer[i][j] = (double)5.1234;<br />
}}<br />
... <br />
}<br />
<br />
void anotherClass::doSomethingWithBuff( doube **b, int x, int y ) {<br />
...<br />
if ( z <= b[x][y] ) {
b[x][y] = z;
}<br />
}<br />
... the b[x][y] is causing my program to crash
What should I be doing instead?
I can't figure out how to prototype doSomethingWithBuff with double[][] instead of
double** or even if I should?
|
|
|
|
|
|
DOH!
Nope I didn't try that! Thanks that did the trick.
Here's what I did try
<br />
void anotherClass::doSomething( double [100][100] b ...<br />
I was thinking that "double [100][100]" was a type!
|
|
|
|