|
It's'a'working.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
I need urgent to know if there is a function in Visual C++ 6
to obtain the size in bytes of a file
I saw that there is a function Filelen() but its for VisualBasic,
there is one similar in Visual C++
I need to know the size in bytes of one file .Wav to send it thorough a socket , but I dont know how to get the size
I have been tried with the function Fread to read the file and to know the size , but all the time it returns me 0,
can somebody help me Urgent !!!
REU
|
|
|
|
|
|
how can I get the Handle
to the file
is the first param in the GetFileSize function
can you help me
|
|
|
|
|
Ok I did it
thanx for your help brotha
the function GetFileSize its perfect (y)
thanx
GOD BLESS YOU
SHALOM
REU
|
|
|
|
|
situation : I'm converting a C struct into a C++ class.
now, I have a function AllocateC that will allocate ( malloc ) the C struct and do some initialization operations on that newly allocated struct.
MyStruct* AllocateStruct( )
{
MyStruct* p = malloc( ... );
DoSomething( p );
DoSomethingElse( p );
return p;
}
now, if I move this into a C++ class with a constructor:
MyStruct::MyStruct()
{
}
The problem is with the additional initialization ( DoSomething DoSomethingElse ) I think I cannot put those into the constructor because the
object is not yet finalized ( fully constructed ).
Is there a 2 step constructor "construct" that I can use, or do I have to keep using a wrapper function to do the new and the additional init.
Thanks.
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote:
The problem is with the additional initialization ( DoSomething DoSomethingElse ) I think I cannot put those into the constructor because the
for non-inherited class objects when the constructor is executing, the object is completely initialised, so it is safe to do the init there, but memory allocation in the constructor is really not a great way to go, what if there is an exception during memory allocation, not a pretty way to recover.
-prakash
|
|
|
|
|
A new Java-like framework has just been released by SwingC.com.
SwingC is a great UI framework that can be used in place of MFC, or any other GUI framework. It has a java-like syntax, and works flawlessly.
|
|
|
|
|
java! not my cup of coffee.
-prakash
|
|
|
|
|
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
|
1. A program that uses function strcmp to compare two strings input by the user. The program should state whether the first string is less than, equal to or greater than the second string.
2. A program that uses function strncmp to compare two strings input by the user. The program should input the number of characters to compare. The program should state whether the first string is less than, equal to or greater than the second string.
3. A program that inputs a telephone number as a string in the form (555) 555-5555. The program should use function strtok to extract the area code as a token, the first three digits of the phone number as a token, and the last four digits of the phone number as a token. The seven digits of the phone number should be concatenated into one string. Both the area code and the phone number should be printed.
Get the string from the user using
cin.getline (sentence, 80);
4. A program that inputs a line of text, tokenizes the line with function strtok and outputs the tokens in reverse order.
Please help and thanks alot
|
|
|
|
|
Anonymous wrote:
Please help...
Exactly what do you want help with? "My homework" is not an acceptable answer.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Sounds a bit like programming homework to me.
As a hint, look up information on the following (google is your friend) and you should be well on your way: strcmp, strncmp, strtok.
|
|
|
|
|
If you want any help, Post your code here. Ask questions why it is not doing what you expect. We are not here to do your homework.
John
|
|
|
|
|
Hello,
I want to know is it possible to catch when my c++(mfc) application is terminated (by other process or by itself), and can i retrieve the name of the process who killed my app. I need this for debug reasons.
Thanks!
|
|
|
|
|
Is there any way to connect to the system registry in Windows XP Home Edition ? RegConnectRegistry doesn't work because bypasses the authentication layer - so how to get around this problem ?
Mila
|
|
|
|
|
Have you tried something like this:
if(::RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"Software\\Example Company\\Example Program\\VersionBuilt",
0, KEY_READ, &hKey) == ERROR_SUCCESS)
{ // Get version
//dwSize = sizeof(dwValue);
DWORD nType = REG_SZ;
unsigned char pRegData[256];
DWORD nBuffLen = 256;
char* pLocation = "VersionBuilt";
RegQueryValueEx(hKey, pLocation, NULL, &nType, pRegData, &nBuffLen);
::RegCloseKey(hKey);
csVersion.Format( "%s", &pRegData[ 5]);
}
|
|
|
|
|
Are you really trying to connect to a registry on a remote machine running WinXP Home Edition?
If 'yes' then forget about it since the function to use is the one you mentioned, ::RegConnectRegistry, and will always fail on the Home Edition.
What you perhaps can do is write an application that acts as a server that you can connect to using sockets and develop your own protocol for reading and/or writing the registry on the remote machine.
If you are trying to read and/or write the local registry you should use ::RegOpenKeyEx or ::RegCreateKeyEx instead.
However, in either case, depending on what access rights the user have running the application that desires access to the registry, the operation might fail due to lack of access rights.
--
Roger
|
|
|
|
|
I need to display the corresponding characters of certain languages in a dialogue application. How can I convert and display values like 062A, 062B etc. ( UCS2, Arabic ) into the matching characters ?
|
|
|
|
|
?? Nobody´s able to help ?
|
|
|
|
|
hi
i am trying MultiByteToWideChar() it returns INVALID_PARAMETER error. is any one know abt it?
here is code snippet
char * chr="hello";
TCHAR str[255];
int nLen = MultiByteToWideChar(CP_ACP, 0,chr, -1, NULL, NULL);
MultiByteToWideChar(CP_ACP, 0, chr, -1, str, nLen);
(i am trying it in eVC 3.0, WCE)
Thanks in advance
|
|
|
|
|
try something like:
char * chr="hello";
WCHAR str[255];
int nLen = MultiByteToWideChar(CP_ACP, 0,chr, -1, str, 255);
-- or --
char * chr="hello";
WCHAR * str;
int nLen = MultiByteToWideChar(CP_ACP, 0,chr, -1, NULL, 0);
str = new WCHAR[nLen];
MultiByteToWideChar(CP_ACP, 0,chr, -1, str, nLen);
delete[] str;
|
|
|
|
|
But i want o use CP_UTF8 code page as first parameter, since i want to convert my ascii string to Japnease.
Regards
Amit
|
|
|
|
|
I have an application that draws a diagram in the form of a bitmap and then displays this in a window. There are limits placed in my code that do not allow
the CSize properties cx and cy to be set to more than 32000 in 'SetViewportExt' and 'SetWindowExt'. This limits my the amount of my diagram that i can draw, and believe it or not someone has managed to make a diagram that exceeds that would exceed the cy component of this diagram. I took these limits out in order to be able to display the whole diagram and it worked well, the CSize objects passed to the 'SetWindowExt' and 'SetViewportExt' methods had cy components that exceed 32000, in fact they were in the region of 69000. However when i doubled the size of my diagram, which is draw as a bit map, it failed. Let us be clear the parameter is was now setting the CSize object to that would be passed to the two previously mentioned methods, were 140000 (cy component) and 2000 (cx) component. The failure was that i had lines running over the top of my diagram, i spoke to someone who was previously involved this project and they told me without those limits, i was "killing the DC", sadly he couldnt tell me, anymore, it seems that there is some sort of limit?
Can anyone help me with understanding this, or perhaps offer a solution
Many thanks
Will
|
|
|
|