|
recently, I use the MFC's CSplitterWnd to split main frame as like "-|" with left pane and right pane , and I also split right pane to top sub-pane and bottom sub-pane, but I want to fix the boder bar between left and righ pane to avoid user to size. Has anyone some ideas to do that? thanks in advance.
|
|
|
|
|
|
See the second question here.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
|
I am having a problem which is as follows see if u can help me-
i have the problem to send the data through serial port in visual c++.pls help me how to do this with the code that is working in window NT/XP enivironment.
|
|
|
|
|
And the problem is ?
What happens EXACTLY ? I mean, with sentences like "it doesn't work" we are unlikely to help you much.
|
|
|
|
|
Come on, it's Friday. Didn't you bring your ESP helmet?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
DavidCrow wrote: Didn't you bring your ESP helmet?
ESP Helment...WOW is it available at Amazon... ..
"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
|
|
|
|
|
I am guessing from your message that you just do not know where to start. I recommend you type 'serial port' in the Search box above and you will get plenty of articles to get you going.
Good Luck
Ali
|
|
|
|
|
omprakashsingh wrote: i have the problem to send the data through serial port in visual c++.pls help me how to do this with the code that is working in window NT/XP enivironment.
Could you show me you code snippet or error you getting while sending data to serial port.
"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
|
|
|
|
|
hi all
iam working on WMI . iam trying to write an application for Event notification.
Iam usimg Win32_Process class, and ExecNotificationQuery for WQl query.
Iam trying to display a message when a new process is created.
my WQL query is
hres = pSvc->ExecNotificationQuery(
bstr_t("WQL"),
bstr_t("SELECT * FROM __InstanceCreationEvent WITHIN 5 WHERE TargetInstance ISA 'Win32_Process' And (TargetInstance.Name = 'notepad.exe' OR TargetInstance.Name = 'calc.exe' ) "),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumerator);
if iam not wrong ,After executing this query TargetInstance will be Instance of WIn32_process class.
and now iam trying extract data usoing this statement
hr = pclsObj->Get(L("TargetInstance.Name"), 0, &vtProp, 0, 0);
but iam not able to get value of Name property of Win32_Process class into vtProp where vtProp is of type VARIANT.
IWbemClassObject->Get( LPCWSTR wszName,LONG lFlags, VARIANT* pVal,CIMTYPE* pvtType, LONG* plFlavor) is used to retrieves Specified property value.
but here iam using it for getting value fron an istance i.e TargetInstance.Name. Is it the correct way to do if not please help me in extracting value of Name Property.
Please help me in solving this .
Thanks in advance
abhi
|
|
|
|
|
How can I determine that the given name is a file or folder?
An option might be to use "fopen". looking at the returned values i can determine that its a file or folder,
But i do not want to use this technique because the file might be in use of an other process; which may cause shairing or other comlex problems.
Any programatic way to safely access the information in directory, because all file folders have entry there?
Thanks in advance
-- modified at 7:28 Friday 17th February, 2006
|
|
|
|
|
GetFileAttributes(...) , GetFileAttributesEx(...) and SHGetFileInfo(...) will help you out here.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
# include <iostream.h>
# include <string.h>
char *GetValue(char);
char *GetValue2(char);
char *GetValue3(char);
void main()
{
char Name[80], IC[14], Amount[9];
int i, n;
cout << "Please write your name: ";
cin >> Name;
cout << "Your ic number: ";
cin >> IC;
cout << "The amount of money: RM";
cin >> Amount;
for(i = 0; i <= 79; i++)
cout << "*";
cout << "Shanghai Bank Berhad, Kuala Lumpur, 55210"<< endl << endl;
cout << "Payee: " << Name << "\t\t\tRM" << Amount <
|
|
|
|
|
1. use <pre></pre> html tags to post codes
2. Indent your code
3. use < and > when you have some < and > not appearing (recognized as html tags...)
4. please indicate where is the error, what is the error... is it a compilation error, or a runtime issue ???
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
A question is given as below:
A whole-sales company requires a program that will help to print cheque like the one below:
Write a C++ program to perform the following:
- Input fields: NAME, IC NUMBER, AMOUNT
- Output : produce the cheque as above with name, ic number, amount and amount in words
example:
amount amount in words
-----------------------------------------
40.00 Forty only
123.00 One Hundred and Twenty Three only
2323.00 Two Thousands Three Hundred and Twenty Three only
Then, my output is as below but occur an error (someone tells me where got error):
#include <iostream.h>
#include <string.h>
char *GetValue(char);
char *GetValue2(char);
char *GetValue3(char);
void main()
{
char Name[80], IC[14], Amount[9];
int i, n;
cout << "Please write your name: ";
cin >> Name;
cout << "Your ic number: ";
cin >> IC;
cout << "The amount of money: RM";
cin >> Amount;
for(i = 0; i <= 79; i++)
cout << "*";
cout << "Shanghai Bank Berhad, Kuala Lumpur, 55210"
<< endl << endl;
cout << "Payee: " << Name << "\t\t\tRM" << Amount <<
endl;
cout << "Amount: ";
i = 0;
n = strlen(Amount);
if(n == 9)
{
cout << GetValue(Amount[i]) << "Hundred ";
n--;
i++;
}
if(n == 8)
{
if(Amount[i] == 49)
{
i++;
cout << GetValue3(Amount[i]) << "Million ";
n -= 2;
i++;
}
else
{
cout << GetValue2(Amount[i]);
n--;
i++;
}
}
if(n == 7)
{
cout << GetValue(Amount[i]) << "Million ";
n--;
i++;
}
if(n == 6)
{
cout << GetValue(Amount[i]) << "Hundred ";
n--;
i++;
}
if(n == 5)
{
if(Amount[i] == 49)
{
i++;
cout << GetValue3(Amount[i]) << "Thousand ";
n -= 2;
i++;
}
else
{
cout << GetValue2(Amount[i]);
n--;
i++;
}
}
if(n == 4)
{
cout << GetValue(Amount[i]) << "Thousand ";
n--;
i++;
}
if(n == 3)
{
cout << GetValue(Amount[i]) << "Hundred ";
n--;
i++;
}
if(n == 2)
{
if(Amount[i] == 49)
{
i++;
cout << GetValue3(Amount[i]);
n -= 2;
i++;
}
else
{
cout << GetValue2(Amount[i]);
n--;
i++;
}
}
if(n == 1)
{
cout << GetValue(Amount[i]);
}
cout << "Dollars" << endl;
for(i = 0; i <= 79; i++)
cout << "*";
}
char *GetValue(char Value)
{
switch(Value)
{
case 48: return "";
case 49: return "One ";
case 50: return "Two ";
case 51: return "Three ";
case 52: return "Four ";
case 53: return "Five ";
case 54: return "Six ";
case 55: return "Seven ";
case 56: return "Eight ";
case 57: return "Nine ";
}
}
char *GetValue2(char Value)
{
switch(Value)
{
case 48: return "";
case 50: return "Twenty ";
case 51: return "Thirty ";
case 52: return "Fourty ";
case 53: return "Fivety ";
case 54: return "Sixty ";
case 55: return "Seventy ";
case 56: return "Eighty ";
case 57: return "Ninety ";
}
}
char *GetValue3(char Value)
{
switch(Value)
{
case 48: return "";
case 49: return "Eleven ";
case 50: return "Twelve ";
case 51: return "Thirteen ";
case 52: return "Fourteen ";
case 53: return "Fiveteen ";
case 54: return "Sixteen ";
case 55: return "Seventeen ";
case 56: return "Eighteen ";
case 57: return "Nineteen ";
}
}
|
|
|
|
|
You REALLY have got to read the message when someone answers your post - please correct your post by doing the things suggested...
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
while (unapplicable)
read <a href="http://www.codeproject.com/script/comments/forums.asp?msg=1374631&forumid=1647#xx1374631xx" rel="nofollow">this</a>[<a href="http://www.codeproject.com/script/comments/forums.asp?msg=1374631&forumid=1647#xx1374631xx" target="_blank" rel="nofollow" title="New Window">^</a>]
endwhile
ps, as it looks like an homework, semms that you'll have to find your way yourself...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
toxcct wrote: while (unapplicable) read this[^]endwhile
"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
|
|
|
|
|
dannysoo2020 wrote: occur an error
Ok, but what error?
It happens during compile or when the program is running?
If it is a runtime error you can mark the program flow with markers like:
cout<<descriptionstring;
to know="" the="" value="" of="" some="" variables="" and="" where="" are="" you="" at="" before="" error.
or,="" better,="" use="" break-points="" on="" your="" c++="" editor="" if="" it="" has="" they.
please,="" be="" more="" clear.=""
<p="" style="background-color:'#50D0B0'">Have a nice code day
|
|
|
|
|
|
I'm really trying to help this guy, so I'm trying to understand if he needs some basic tips.
And, of course, trying to use a 'friendly' message!;)
Have a nice code day
|
|
|
|
|
SORRY guys. I'm a newbie in programming, know nothing , this is my 1st assignment to learn about C++. Thx for your help anyway. ;)
|
|
|
|
|
Ooops , forgot to tell you all never mind already, already can run the program with changing the front parts :
#include <iostream>
#include <string>
using namespace std;
Thanks again to all of you, thanks thanks thanks.
Danny
|
|
|
|
|
dannysoo2020 wrote:
A question is given as below:
Yes, but what problem are you having. We know what the assignment is, but you have not indicated the section of code that is troubling you.
See here for clues.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|