|
explicit CFileDialog(
BOOL bOpenFileDialog,
LPCTSTR lpszDefExt = NULL,
LPCTSTR lpszFileName = NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
LPCTSTR lpszFilter = NULL,
CWnd* pParentWnd = NULL,
DWORD dwSize = 0
);
You'd better search the MSDN.
|
|
|
|
|
Anonymous wrote:
onFileopen() should work but its ging error saying its a protected member and cannot be accessed
Show us the code snippet that the compiler is complaining about.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi,
Here is my situation:
RepliGo is a utility that allow you to convert Office file to RepliGo file for reading them in Palm. RepliGo provide a virtual printer for us to do that work.
My application is built as the server/client model. Server run as windows service. Client will request Server to convert Office files to RepliGo files through socket.
In Server side, I'm using RepliGo's virtual printer to convert Office file (.DOC, .XLS, .PPT) to .RGO file.
I used DDE command to do that work. For example, with .DOC file, I have DDE command :
-------------------------------------------------------------------------
[REM _DDE_Minimize][FileOpen("%1")][t=IsDocumentDirty()][FilePrint 0][SetDocumentDirty t][DocClose]
(Can find it in Registry)
-------------------------------------------------------------------------
And I used classExec utitlity to run that DDE command.
My problem is:
+ When I login Window with specified User. Client can request Server to convert all files.
+ But when I restart computer, not yet login window (standing at Login form). Client can't request Server to convert any file.
(May be I have not logged in Window yet, so I don't have DESKTOP for RepliGo's virtual printer to run)
Please tell me how to solve with this problem.
Thanks a lot.
|
|
|
|
|
hi, guys, now I developed a simple activex document server program, using it to produce an activex document file, open it with ie(on win2k), it works fine with embeded, when I open it with ie(on xp), it pops another new document server program window and opens it in that new program, not open it in ie!
the question is:
how can I make ie(on xp) open the activex document same as ie(on win2k) works.
by the way, I'm from china and speak poor english, hope I can be understood.
thanks, best regard.
|
|
|
|
|
Dear All,
Could any one , please help me to solve my grid control problem.
I would like to disable some of the columns in the grid but when I use m_grid.SetEnabled(FALSE) it disables the whole grid.
Please I need it urgent.
|
|
|
|
|
I have a question about edit text boxes and CString. In my program I have a text box for the user to write a message in. I want to be able to make what they input in reverse. So how do I separate each character from the text box going in to a CString.
CString strString;
strString = m_String;
Then I have a for loop to start at the end number of the string and go down displaying each letter as the increments decrease. I would do this by int x = strString.GetLength(); Right? Now how do I separate each character of the string to make an array. Like for the message "Hello" strString[0] would be "H" and so on. If I do this
for(x=strString.GetLength(); x>=0;x--)
m_Reverse += strString.GetAt(x);
It gives me the whole message for every character. So how do I make each array index (x) be one character and not all of the characters? Thank you so much for your help. I am going to learn MFC, yet.
Stephen Doty
StephenDoty@yahoo.com
|
|
|
|
|
You can use MakeReverse to reverse a CString .
|
|
|
|
|
use this code:
TCHAR arrCharacters[1024];<br />
CString sMyString;<br />
<br />
sMyString = "hello";<br />
<br />
for (int i = sMyString.GetLength(); i >= 0; i--)<br />
arrCharacters[i] = sMyString.GetAt(i);<br />
Geert
Want to spread the newest version of your software automatically? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
When I used the MakeReverse I got an error saying that the = sign was invalid. If I typed m_String.MakeReverse, or m_String = m_String.MakeReverse, it just gave me back the input from the text box. I even tried making a separate CString, such as, CString String; String = m_String; String.MakeReverse; m_Answer = String; Please help. And thank you for the responses.
UpdateData(TRUE);
m_String.MakeReverse;
m_Answer += m_String;
UpdateData(FALSE);
Stephen Doty
|
|
|
|
|
I assume you mean
strString.MakeReverse();
this method reverses the string internally, you don't set a new string equal to it.
|
|
|
|
|
Right now my Serial Library works. i can read/write correctly, However i do not think I am doing it optimally and I know that I am not doing it the overlapped way. So maybe you could help me to optimize my serial read/write function so that it is done correctly. Right now i am using a for loop to read X number of bytes from the port. Problem with this method is that it will loop forever if X # of bytes are never read.
What I want to be able to do is read from the port until there is no more bytes to read. That way i dont always need to know how many bytes I need to read and the read wont block the program flow indefinitely.
Below is a sample of how i would currently read from the port:
<br />
for( Size = 0; Size < 5 ; )
{
ReadFile(hComm, &Buf, 1, &IncomingReadSize, NULL);
if(IncomingReadSize > 0)
{<br />
Size += IncomingReadSize;
packetbuf[x] = Buf;
x++;
}<br />
}
This just seems horribly inefficient to me. Anyone else think so?
|
|
|
|
|
You may want to take some ideas from Ramon de Klein's Serial library[^].
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I am very new to the C++ programming scene and I am kind of lost on this one and need some help. I will post the code I have so far and maybe somebody can set me straight as to what I am doing wrong. The program should use a random number to simulate the first die and a second random number to simulate a second die. Then the program should calculate the sum of those two numbers. Each die can show an interger value from 1 to 6, so the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums. The program should roll the dice 36,000 times. It should use a single-subscripted array to tally the numbers of times each possible sum appears. The results should be in tabular format. This one is really throwing me so if somebody could show me the right way to do this it would be a big relief.
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
int _tmain()
{
Random *randomNumber = new Random();
int die1,
die2;
int frequency __gc[] = new int __gc[13];
double total;
//roll dice, calculate sum and display results
int RollDice(Random *randomNumber)
{
int die1, die2, workSum;
die1 = randomNumber->Next(1, 7);
die2 = randomNumber->Next(1, 7);
workSum = die1 + die2;
Console::WriteLine(S"Player rolled {0} + {1} = {2}",
die1.ToString(), die2.ToString(), workSum.ToString() );
return workSum;
} //end function RollDice
for (int roll = 1; roll <= 36000; roll++){
die1 = randomNumber->Next(2, 13);
++frequency[die1];
die2 = randomNumber->Next(2, 13);
++frequency[die2];
} //end of loop
total = 0;
for (int i = 1; i < 13; i++)
total += frequency[i];
Console::WriteLine(S"Face\tFrequency\tPercent");
//output frequency values
for (int x = 1; x < frequency->Length; x++)
Console::WriteLine(S"{0}\t{1}\t\t{2}%", x.ToString(),
frequency[x].ToString(),
(frequency[x]/total * 100).ToString("N") );
return 0;
} //end _tmain
|
|
|
|
|
bartman1437 wrote:
[Description of what seems to be homework snipped]
This one is really throwing me so if somebody could show me the right way to do this it would be a big relief.
What's exactly the problem you are experiencing? Don't expect anyone to do your homework. Post specific questions and somebody might help.
Do you actually have the entire RollDice function defined inside the _tmain function, or was just an error while pasting the code in your post? Where is RollDice being called?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I didn't ask anybody to do it for me. What I asked for was some help in doing it the right way. Not some egomaniac full of himself who just wants to make it hard on somebody trying to learn the right way.
Anyway, I did it myself, it was less aggravation than dealing with people like you.
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
int _tmain()
{
//initializing variables
Random *randomNumber = new Random();
int face1;
int face2;
int sum;
const int ARRAY_SIZE = 13;
int frequency__gc[ARRAY_SIZE];
double total;
//simulating the rolling of the two dice
for (int roll = 1; roll<=36000; roll++)
{
face1 = randomNumber->Next(1,7);
face2 = randomNumber->Next(1,7);
sum = face1 + face2;
++frequency__gc[sum];
}
total = 0;
for (int i= 1; i < 13; i++)
total += frequency__gc[ i ];
Console::WriteLine(S"Sum:\tFrequency:");
//output the sum and frequency values
for (int x = 2; x < ARRAY_SIZE; x++)
Console::WriteLine(S"{0}\t{1}", x.ToString(),
frequency__gc[ x ].ToString());
return 0;
}
|
|
|
|
|
bartman1437 wrote:
I didn't ask anybody to do it for me. What I asked for was some help in doing it the right way.
Just to put this into context, what you did was to describe your homework assignment, along with 50+ lines of code and this phrase:
bartman1437 wrote:
This one is really throwing me so if somebody could show me the right way to do this it would be a big relief.
That is, no indication of what exactly was your problem, what errors you were getting, or any specific question; just a general "if somebody could show me the right way to do this."
My response was precisely pointing that out, and although in a shorter way, not very different than what is said in this FAQ - What's the best way to ask a question about code, so that I get a good answer?[^]. For the record, these were my exact words:
Jose Lamas Rios wrote:
What's exactly the problem you are experiencing? Don't expect anyone to do your homework. Post specific questions and somebody might help.
Concise and to the point. I don't think anyone would take offense to that; it wasn't my intention in any case.
After that, I nonetheless suggested you some things that, on a quick first sight, seemed wrong. I was even polite enough to allow for the possibility that the error was only at composing your post and not in the actual code:
Jose Lamas Rios wrote:
Do you actually have the entire RollDice function defined inside the _tmain function, or was just an error while pasting the code in your post? Where is RollDice being called?
And that was it. Nothing else was in my response to your post. Granted, I didn't take the time to cut and paste your post into a source file, compile it, fix whatever errors it had, and present it back to you as working code. But I don't think I was expected to do that, was I?
So, it was a big surprise for me to read the following in your reply:
bartman1437 wrote:
Not some egomaniac full of himself who just wants to make it hard on somebody trying to learn the right way. Anyway, I did it myself, it was less aggravation than dealing with people like you.
You did it yourself? Good! That was the idea in the first place. As for the rest, you won't get any further response. I don't get into name calling or flame fests.
Good luck,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
in my app, there are many files. when I pause, it is not inside file1.cpp, but stoped in file2.cpp.
I think this matters. if it stoped in file1.cpp I can see this variable.
Best
|
|
|
|
|
What on earth are you talking about ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I think it has to do with his other post below.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
Yeah, I guessed that was probably the case. It made no sense to me, and I'm sure a lot of other people, due to the nature of the post. He should comment under his current post, obviously.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello Graus,
Can you please provide me some suggestions regarding VC++, MFC as I want to learn more of C++ and MFC. I am already into VC++,MFC but wants to learn more so that I can help people in solving their problems. If possible, can you provide me ur MSN mail id so that when time permits I can learn from you.
Thanking you,
Regards,
Neelesh K J Jain.
|
|
|
|
|
Neelesh K J Jain wrote:
Can you please provide me some suggestions regarding VC++, MFC as I want to learn more of C++ and MFC.
There are tons of MFC articles on this site, just go to the articles section.
Neelesh K J Jain wrote:
If possible, can you provide me ur MSN mail id so that when time permits I can learn from you.
I answer about 20-40 questions a day. Can you imagine if I gave all those people my MSN ? But by all means, ask here and I'll be one of many people happy to help you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Try breakpoints..?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Sorry for my confusing question. And I am glad that smart people figured it out. Thank you for all your guys warm reply.
|
|
|
|
|
buf_balance is a globel variable. when defined in file1.cpp
int buf_balance;
then i run app in debug mode. I pause the app, want to check the value of buf_balance. but I got error in my watch list.
Why can't I see this variable?
Thank you in advance.
Richard Luo
|
|
|
|
|