|
//k.h
//class k
class k
{
public:
k(){ cout<<"hi, how are you?\n"; } // need closing brace
};
//s.cpp, main method
#include "k.h"
void main()
{
k aclass;
}
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
i found it
the problem is on including a header.. i got the case problem.
#include "job.h"
#include <iostream.h>
#include <fstream.h>
#include <Afx.h> // it's <afx.h> not <Afx.h>
now everything fine.. thanks
|
|
|
|
|
i found it
the problem is on including a header.. i got the case problem.
#include "job.h"
#include < iostream.h >
#include < fstream.h >
#include < Afx.h > // it's < afx.h > not < Afx.h >
now everything fine.. thanks
|
|
|
|
|
CMyForm* prova;
prova = new CMyForm;
prova->m_edit.SetWindowText("ciao");
delete prova;
This doesn't work.
And the error is:
void CWnd::SetWindowText(LPCTSTR lpszString)
{
ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
if (m_pCtrlSite == NULL)
::SetWindowText(m_hWnd, lpszString);
else
m_pCtrlSite->SetWindowText(lpszString);
}
Because as Nish said
That won't work. The edit control has not been created yet!!!
So here comes my question:
How I create an edit control on another form so that I can use functions of it from other frames?
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
You need to call Create or CreateWindow, too. Sorry, I'm too lazy to put in the MSDN CD currently It's one of these functions.
What you are doing is creating the class with new, but not the window which is encapsulated. This requires a second step.
Martin
|
|
|
|
|
How can I understand if a drive is NTFS or FAT32 in my program?
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
NTSF:
template "Boot Sector NTFS"
// Template by Paul Mullen, pcguru@the-answer.com
// last modified Jul 16, 2000
// To be applied to sector 0 of an NTFS-formatted
// logical drive or to the mirror copy of the boot
// sector, which will be located near the end of
// the partition.
// See Microsoft KB article Q153973, "Recovering NTFS boot Sector"
// http://support.microsoft.com/support/kb/articles/Q153/9/73.asp
description "Boot sector of an NTFS partition"
applies_to disk
sector-aligned
requires 0x00 "EB" // bytes 0 to 2 are
requires 0x02 "90" // JMP instruction
requires 0x03 "4E 54 46 53 20" // ID must be "NTFS"
requires 0x1FE "55 AA" // "magic" signature
begin
read-only hex 3 "JMP instruction" //00
char[8] "SystemID" //03
uint16 "Bytes per sector" //0B
uint8 "Sectors per cluster" //0D
uint16 "Reserved sectors" //0E
hex 3 "(always zero)" //10
read-only hex 2 "(unused)" //13
hex 1 "Media descriptor" //15
read-only hex 2 "(unused)" //16
uint16 "Sectors per track" //18
uint16 "Heads" //1A
uint32 "Hidden Sectors" //1C
read-only hex 4 "(unused)" //20
read-only hex 4 "(always 80 00 80 00)" //24
int64 "Total sectors" //28
move -8
hex 8 "Total sectors (hex)" //28
int64 "Start C# $MFT" //30
int64 "Start C# $MFTMirr" //38
uint32 "Clust per MFT rec" //40
uint32 "Clust per index block" //44
uint32 "Serial number (int)" //48
move -4
hex 4 "Serial number (hex)" //48
goto 0x1FE //boot load code follows
read-only hex 2 "Signature (55 AA)" //1FE
end
FAT32
template "Boot Sector FAT32"
// Template by Stefan Fleischmann
// To be applied to sector 0 of a FAT32-formatted logical drive.
description "BIOS parameter block (BPB) and more"
applies_to disk
sector-aligned
requires 0x02 "90"
requires 0x52 "46 41 54 33 32" // ="FAT32" at offset 52
requires 0x1FE "55 AA"
begin
read-only hex 3 "JMP instruction"
char[8] "OEM"
section "BIOS Parameter Block"
uint16 "Bytes per sector"
uint8 "Sectors per cluster"
uint16 "Reserved sectors"
uint8 "Number of FATs"
uint16 "Root entries (unused)"
uint16 "Sectors (on small volumes)"
hex 1 "Media descriptor (hex)"
uint16 "Sectors per FAT (small vol.)"
uint16 "Sectors per track"
uint16 "Heads"
uint32 "Hidden sectors"
uint32 "Sectors (on large volumes)"
section "FAT32 Section"
uint32 "Sectors per FAT"
uint16 "Flags"
uint16 "Version"
uint32 "Root dir 1st cluster"
uint16 "FSInfo sector"
uint16 "Backup boot sector"
read-only hex 12 "(Reserved)"
endsection
hex 1 "BIOS drive (hex, HD=8x)"
read-only uint8 (Unused)
hex 1 "Ext. boot signature (29h)"
uint32 "Volume serial number (decimal)"
move -4
hex 4 "Volume serial number (hex)"
char[11] "Volume label"
char[8] "File system"
endsection
goto 0x1FE
read-only hex 2 "Signature (55 AA)"
end
|
|
|
|
|
Whats that? I just need something like win32 functions.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
It's how an NTFS and a FAT32 partition entrance looks like.
|
|
|
|
|
Thank you.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Use GetVolumeInformation()
the Function params are
BOOL GetVolumeInformation(
LPCTSTR lpRootPathName, // root directory
LPTSTR lpVolumeNameBuffer, // volume name buffer
DWORD nVolumeNameSize, // length of name buffer
LPDWORD lpVolumeSerialNumber, // volume serial number
LPDWORD lpMaximumComponentLength, // maximum file name length
LPDWORD lpFileSystemFlags, // file system options
LPTSTR lpFileSystemNameBuffer, // file system name buffer
DWORD nFileSystemNameSize // length of file system name buffer
)
the out var lpFileSystemBuffer will give you the info abt
Type of ur partition(NTFS/FAT)
try it..
The TRUE CP -ian
|
|
|
|
|
Thank you.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Always Welcome my friend...
R_Renjith The True CP ian
|
|
|
|
|
how to rotation a dialogbox??
example: rotation 45 degree!
I'm a beginner of VC++...
|
|
|
|
|
THe only way that is possible is to make a userdrawn window.
|
|
|
|
|
oh. my god! that's so......
i can't image that i need draw 100 windows!
I'm a beginner of VC++...
|
|
|
|
|
I'm confused with booleans. If I have these kind of methods in my classes
bool withdraw(float amount,Account a);
bool transfer(float amount,Account s,Account c);
could I still use couts and cin in my void main
|
|
|
|
|
I'd say your confused. So much so that I don't undestand the question.
--
Where are we going? And why am I in this handbasket?
|
|
|
|
|
I mean can the following be done:
bool Bank::withdraw(float amount,Account a);
cout<<"\nEnter a positive amount for the withdrawal-$";
cin>>amount;
while(amount<=0)
{
cout<<"\ninvalid amount";
cout<<"\nEnter a positive amount for withdrawal-$";
cin>>amount;
}
If there was an int or float in the place of bool I would not be so lost.
|
|
|
|
|
bool is just another type of variable, nothing magical about it.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Dee wrote:
could I still use couts and cin in my void main
This has no connection with having a function that returns a bool.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
How to create user in Active Dir on XP,2k
Please give sample code in VB+VC
...
Ibrar Ahmad
Softare Engr.
Comcept PVT LTD.
Islamabad
abrar_@yahoo.com
|
|
|
|
|
|
hi,
how can i get the height and width of a window?
|
|
|
|
|
Send a Message to that windows Hwnd
I'm a beginner of VC++...
|
|
|
|