|
kakan wrote: It's very informational (Is that an English word? )
look like to be
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
It felt good when I wrote it. But then I began to wonder.
Anyway, as long as the reader gets the message, anything goes (as far as I'm concerned)
|
|
|
|
|
Help to run my project in Se
dil
|
|
|
|
|
usha_dolly wrote: Help to run my project in Se
I believe you want to run your program as service. This link will help :-
http://www.codeproject.com/system/xyntservice.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
-- modified at 6:45 Tuesday 6th December, 2005
|
|
|
|
|
|
I create another dialog box from my main dialog box. I want to show it and remove it when i want, without the user's will. I call the show function and the remove function from different places, and 90% I am able to remove it. For the other 10% I tried calling DestroyWindow() to remove, or calling it in the class destructor. I also tried overriding PostNcDestroy() and calling CDialog::PostNcDestroy() inside, etc. OnDestroy(), PostNcDestroy() and OnNcDestroy() are called respectively, but I keep seeing the dialog box, it is not removed. Can someone please help me? How can I destroy it properly?
Thanks in advance
To show:
pOtherBox = new COtherBox();<br />
BOOL ret = pOtherBox->Create(IDD_OTHERBOX, this);<br />
<br />
pOtherBox->SetWindowPos(&this->wndTopMost,<br />
left,top,width,height,<br />
SWP_NOREPOSITION|SWP_NOSENDCHANGING|SWP_NOACTIVATE|SWP_SHOWWINDOW);
To remove:
if(pOtherBox!=NULL)<br />
{<br />
delete pOtherBox;<br />
pOtherBox = NULL;<br />
}
|
|
|
|
|
To dismiss the modeless dialog box, simply call:
pOtherBox->DestroyWindow();
And also implement:
void COtherBox::PostNcDestroy()
{
delete this;
}
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
|
gpswamy wrote: how to get window handle pls
In MFC :-
AfxGetApp()->GetSafeHwnd();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
In MFC, If you need the window handle of the current window, then it is m_hWnd
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Hi,
I am trying to read data from a textfile, but I can't seem to open the file. Here's the code I use:
<code>void fileOperator::openInputFile(const wchar_t *fname)
{
inFile.open(fname, std::ios_base::in);
if(!inFile.is_open() )
{
printf("File could not be opened\n");
exit(1);
}
}</code>
I get no error messages from the compiler, but when I run the program, I get the "File could not be opened" error. I have checked that the program and the textfile are in the same directory. This should be the simplest thing and I'm practically tearing my own hair out trying to figure it out. Please help!
Roger
|
|
|
|
|
is the function called with a valid file path as a parameter ??
what happens if changing fname from const wchar_t* to const char* ?
where is defined inFile ? is it well initialized ?
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
|
|
|
|
|
Hi,
Sorry, here is the definition for the class I'm using:
#include <stdio.h>
#include <fstream>
#include <vector>
#include <ios>
class fileOperator {
protected:
<
std::ifstream inFile;
std::ofstream outFile;
public:
fileOperator() {};
void openInputFile(const wchar_t *fname);
void openOutputFile(const wchar_t *fname) {};
void readMatrix(int numberOfColumns, double **matrix);
};
Using const char* was my first thought too, but my compiler doesn't seem to like it. It claims ifstream::open only accepts wchar_t* as its argument. Here's the compiler error I get:
.\fileTest.cpp(8) : error C2664: 'fileOperator::openInputFile' : cannot convert parameter 1 from 'char *' to 'const wchar_t *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
There might be some blindingly obvious thing I'm missing here as I'm fairly new to C++
Roger
|
|
|
|
|
you have to either wass it a char* string and to change the function prototype !!!
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20]
|
|
|
|
|
Sorry about that, with the function prototype changed to char*, the code compiles of course, but I still can't open the file...
Roger
|
|
|
|
|
"wchar_t *fname"?
You might considder "char * fname"?
Or a UNICODE build?
|
|
|
|
|
Does the path to the file look like this ?
const char *path = "C:\Test\TestFile.txt";
If that's true, then you need to escape the \ character by addding another \. Like
const char *path = "C:\\Test\\TestFile.txt";
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
Sorry, I'm not using the full path. The file I'm trying to read is in the same directory as the program itself. I tried using full path with the double \\, but to no use. The file still won't open.
Roger
|
|
|
|
|
I need to get my floating points calculation to run faster, the floating point numbers stored in instances of some class in vector<class> array I just need to multiply them and add result:
class{
float val1;
float val2;
};
for(i=0; i<size; i++)
="" res="" +="class[i]-">val1 * class[i]->val2;
will it be faster to store floating numbers from vector massive to plain floating array
float *ar1, *ar2;
for(i=0; i<size; i++)
="" ar1[i]="class[i]-">val1;
ar2[i] = class[i]->val2;
and then perform mmx calculations or memory moving ops will take also some time so there will be no significant speed increase? Or will it be faster to use compound intrinsics to load floating numbers to float[4] and then perform multiplication?
If some one encountered similar problem?
9ine
|
|
|
|
|
9ine wrote: perform mmx calculations
MMX instructions are all integer-based, so they can't help you at all with floating point calcs.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
I know about mmx, by this word I mean all multemedia extensions, it is SSE with floating points which I wonder about for my application if you need me to be more exact.
I can do it my self easely but dont want to waste time if some one done it before an got speed improvement, which I mean:
timemmx = [mem move from classes in vector<> array] + [SSE ops]
timefloat = [standart floating multiplications]
timemmx << timefloat! ??
Otherwise I will need to make much bigger changes in my code to get floating values from my vector<class> to align them in memory, which I'm reluctant.
9ine
|
|
|
|
|
i'm not sure anyone could say for sure without actually trying.
but, items in a vector are stored contiguously in memory, so you can treat them as a plain C++ array. (this is part of the 2003 C++ standard, IIRC - and all implementations store data that way regardless). so, you should be able to load the SSE registers directly from the contents of your vector.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
actually not the floating points are stored in vector but class instances with floating numbers
class CTest
{
public:
CTest();
~CTest();
float val1;
float val2;
}
and we get this vector<CTest *> array and we need to
for(i=0; i<array.size(); i++)
res += array[i]->val1 * array[i]->val2;
if we can try it keeping in mind that data in vector is stored lineary hence val1 and val2 stored with the same stride in memory?
9ine
-- modified at 9:42 Wednesday 7th December, 2005
|
|
|
|
|
16:00 IST
Good Afternoon to all of you,
My problem is based on changing the mouse pointer at the button click .
Like in ms-paint on clicking the the line button the mouse icon gets changed.
I would be highly obliged for the early response
Thanks and regards
|
|
|
|
|
pankajgarg11 wrote: Like in ms-paint on clicking the the line button the mouse icon gets changed.
Is SetCursor Api is of any help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|