|
its just try ..if it is that create run time u may be add fopen
|
|
|
|
|
The way you show your m_filename is not an absolute path, but a relative path.
When you run from within VS (Ctrl_F5) the default working directory is the same folder as your .sln/.vcproj file. Let's say it's "MyProg", thefore you would attempt to open the file in VS, the path would be
MyProg\some absolute file path\name However, if you run it from the Windows Explorer (double click on it) the default directory would be the location of the .exe. In this case, it might be
MyProg\debug\some absolute file path\name The CStdioFile.Open will not create directories if the don't exist, and that would cause it to fail.
Perhaps if you show the actual contents of your m_filename it may be helpful.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Thanks for your help, but I'm always looking into the m_filename and I'm sure that was absolute. Something newly found today that when I call m_file.Open() I got an warnning message:Warning: could not get volume information 'd:\Documents and Settings\mmn7xxl\My Documents\My Project\Program\WareHouseReport\"d:\' . Can you figure this out for me?
Lisoft
|
|
|
|
|
That string can't really be a file name.
lisoft wrote: d:\Documents and Settings\mmn7xxl\My Documents\My Project\Program\WareHouseReport\"d:\
Show the actual code where you build that string and maybe we can help.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Maybe you have this file, can you show path?
|
|
|
|
|
Hello and good day!
I want to implement a virtual keyboard for my project. Although the Windows XP already provides one for use, I need the buttons and font to be bigger in size. I'm thinking of currently creating my own virtual keyboard but I want to make sure first if there would be other ways available. Should I create one or are there any other easier methods that I can use? If you say that I should create one, giving me pointers on what is needed would be a great help (currently reading SendInput function). Please note that what I'm gonna implement is a japanese keyboard and buying software is not an option.
Thank you for the help and time! 
|
|
|
|
|
Hi,
As MainFramer I knowing that knowing Assembler always helped understand concepts
Anyway to the point I wrote some inline _asm code in a Method
In order to access the data in the Class I realized that the "this"
pointer (pointer to the object) resides on the stack after
paramter variables
I also relized when trying to initilize data with static that I had
to do it in the program
Why ??? the storage for static attribue members do not reside in the
Object rather in the program
This point was further driven home in my _asm code I tried to
access the data the way it was documented on the MSDN page
following is the the code from the MSDN web page
InlineAssembler_Accessing_C_asm_Blocks.cpp
// processor: x86
#include <stdio.h>
struct first_type
{
char *weasel;
int same_name;
};
struct second_type
{
int wonton;
long same_name;
};
int main()
{
struct first_type hal;
struct second_type oat;
__asm
{
lea ebx, hal
mov ecx, [ebx]hal.same_name ; Must use 'hal'
mov esi, [ebx].weasel ; Can omit 'hal'
}
return 0;
I used the following code to access the data in a my Class
First a example of my class
class MYClass
{
private:
static char *c;
static int d;
public:
.
.
.
etc
Now My _asm code
void MYClass :: class(int a, int b)
{
_asm
{
mov ebx,DWORD PTR 16[ebp] ; get this pointer
lea esi,[ebx].d
I got a compile/assemble error when "d" os declared as static
: error C2411: 'd' : illegal struct/union member in 'second operand'
Makes sense becuase when d is declared as static the storage doesn't
reside in the Object
So Whats my question ????
If I use the static attribute how can I access it in _asm code
Thankx
|
|
|
|
|
I have had this problem before, I just cheated.
int *dPtr = &d;
then u can just lea the dPtr value.
|
|
|
|
|
I got error LNK2001 When I tried that I didn't Lea since the pointer had the address all I had to do was a mov instruction
|
|
|
|
|
I'm creating a backup program, and I need to be able to open files with the ACCESS_SYSTEM_SECURITY privilege.
However, when I specify this privilege in my call to CreateFile, it tells me I'm missing a "required privilege" even when I run it as Admin.
This is on Vista.
What are the steps for getting the required privilege to open files with this access right?
“Cannot find REALITY.SYS...Universe Halted.”
~ God on phone with Microsoft Customer Support
|
|
|
|
|
hi
i have created adialog based application.but i just found out recently that it is hard to link a database to adialog("such as displaying results in an edit box ")
Is it really that difficult??
and can some one tell me how to do it???
please i really need it ("its for my project and i will reach my time limit soon ")
please >>>any help will be appreciated.
thank u in advance
Lahom
|
|
|
|
|
Did you search on the codeproject?
|
|
|
|
|
Hi,
I wanna know how could i drew a few cercles just by typing with lines of code. I'm under MFC on MSVS 6.0. is there some struct that could help me to drew such shapes?
hope that i wrote right
And thank you.
"The Ultimate Limit Is Only Your Imagination."
modified on Sunday, April 6, 2008 4:21 PM
|
|
|
|
|
Do you mean something like this?
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
dc.Ellipse(10, 10, 50, 50);
}
Or do you want to write the circle drawing code yourself? If so, Google "circle drawing algorithm".
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ok so let's say that i wanna drew 3 cercles on my formview, so shoulf i write that code 3 times with different values?
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
did ever heard about loops?
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
|
|
|
|
|
CPallini wrote: did ever heard about loops?
These?[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Exactly.
BTW turn off your CPMRU , it is not fair using such device for this kind of guess.
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
|
|
|
|
|
lol, I know about loops but the prob that i dont know how many circles that the user wanna, let say 2O so how could i declare the 20 vars for those cercles
for (i=0 ; i< 20; i++)
{
Cercle[i].....??
}
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You could store the coordinates in an array.
An array container that grows automatically would be even better, like a vector or a CArray.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
yup i'm using a vector
but is the form "Formview" suitable for drawing or should i select another type?
i'm new on drawing :s
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Ok I'tested on a FormView and it works i had a white circle it was a stupid querstion
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
You can draw on any window.
A CFormView is useful when you have controls you need to layout on the window like a dialog window.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You don't necessarily have to write the code three times.
However you write the code, it must call Ellipse() three times.
These are two equivalent examples:
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
dc.Ellipse(10, 10, 50, 50);
dc.Ellipse(30, 30, 70, 70);
dc.Ellipse(50, 50, 90, 90);
}
void CMyWnd::OnPaint()
{
CPaintDC dc(this);
CRect CircleRect(10, 10, 50, 50);
for (int i = 0; i < 3; i++)
{
dc.Ellipse(&CircleRect);
CircleRect.OffsetRect(20, 20);
}
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
when i click on the butoon nothing is drawin !!!
is it a prob of reference to the dc .?
<br />
void CSecondForm::OnButton1() <br />
{<br />
<br />
CPaintDC dc(this);<br />
dc.Ellipse(20, 20, 100, 100);<br />
}<br />
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|