|
Hello everybody,
I have a big understanding problem.
If I write those 2 lines
InvalidateRect(CRect(0,10,0,10));
GetUpdateRect(testrect);
Then "testrect" is empty. Shouldn't it get the values of my InvalidateRect?
Big thanks for any help 
|
|
|
|
|
In fact, your rectangle is empty: CRect constructor accepts, as parameters, rectangle's {left,top, right, bottom}. See CRect constructor at MSDN.
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
[My articles]
|
|
|
|
|
Hi all,
i m using access database with odbc connection.
here in table i m using a Memo data type.
when i save value upto 255 char in this field its working fine but when i put more than 255 its generate problems.
its gives such type of error.
Mfc internal error: unable to load error string from resource
and generate CDBException at memory location 0x0885fb9c..
please help me for this.
i cant understand what can i do.
thanks in advance.
|
|
|
|
|
Access memo fields only support 255 characters maximum.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
but i think memo field support more than 255 char.
|
|
|
|
|
Happily, what you think has no retrospective effect on the design of the Jet database engine.
It's theoretically possible to store more than 255 bytes in a memo field but there are lots of circumstances in which Access will truncate it to 255 bytes anyway. It treats memo fields like other text fields which have a limit of 255 characters.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
ok now please tell me what can i use for more than 255 char.
|
|
|
|
|
Use an OLE Object field; it's really just for large blobs of binary data.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
please explain me how can i do this.
|
|
|
|
|
Hi,
I have written the an application which configures the DHCP server using c#.
Environment:
Hyper-V Windows 2008 Server R2
API used to crerate subnet is : DHcpCreateSubnet.
Return code: 5
The above return code is received when used for the first time. In second attemp when DHCPCreate subnet is called it succeeds to create the subnet for same IP used as scope address.
For e.g
1st Attempt: Exe is executed first time,.
API used : DHCPCreateSubnet Error code :5 IP used for scope address : 192.168.1.10
2nd Attempt: Exe is executed second time,.
API used : DHCPCreateSubnet Error code :2005 (success), IP used for scope address : 192.168.1.10
Please let me know if you any information on Hyper-V why its is failing for the first time.
Regards
-Ganesh
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
Ganesh_T wrote: I have written the an application which configures the DHCP server using c#.
Then, why do you post your question on the C/C++/MFC forum? The right one is the C# forum...
Ganesh_T wrote: API used to crerate subnet is : DHcpCreateSubnet.
...or you can post the question to the Windows API forum, as you are using one of them through P-Invoke.
|
|
|
|
|
A Visual Studio 2008 console program gets some data in an array of bytes. I want write the data to the console as both ascii and binary. For example if the array contains:
61 62 63 64 65 0 1
The display should look something like:
a b c d e : 61 62 63 64 65 00 01
What data type should I use to hand off to Writeln as in:
Console::WriteLine( "01: {0}", what_data_type );
Edit: To state it better: What would you use to build a string one character at a time?
Thanks for your time
modified on Sunday, October 24, 2010 8:58 PM
|
|
|
|
|
What type is the original array?
61, 62 etc. are hexadecimal representations of a, b etc.
The corresponding ascii value is 97, 98 etc.
If you have a numeric array, you could either convert each item to string using ToString and then use Int32::Parse and Console::WriteLine -
foreach (int i in myarray)
{
int ii = int::Parse(i.ToString(), NumberStyles::HexNumber);
Console::WriteLine("{0} {1:X}", Convert::ToChar(ii), ii);
}
|
|
|
|
|
I am trying to learn to write some TCP/IP code and will receive data as just a bunch of bytes. It can be a char array or a byte array. The important part is suffing the data into some type of string so that I can write it to the display. I'll put text in the left 40 characters replacing non-printables with .. and show the data as hex in the right 40 characters. That way the sender can send anyting and I can see that its being sent and received correctly.
I am using a console based project in Visual Studio C++ just to get something going quickly.
Thanks for your time
|
|
|
|
|
If you have a char array, the code that I posted must pretty much work.
|
|
|
|
|
Then I am missing a few things in your post.
foreach (int i in myarray)
{ int ii = int::Parse(i.ToString(), NumberStyles::HexNumber);
Console::WriteLine("{0} {1:X}", Convert::ToChar(ii), ii);
}
Wyere is myarray referenced?
There is an int on the left side of the =.
I would like to put the data into some kind of a string or character variable then send it out.
The WriteLine will send out a new line for each iteration. WriteLine can be changed to Write, but I still want to build an character based variable.
Thanks for your time
|
|
|
|
|
As per your original post you said the program gets an array.
myarray is assumed to be that array.
If you do not have it, you got to create it.
You could create a string variable and use string::Format instead of Console::WriteLine to do what you want to do.
They are very similar.
|
|
|
|
|
Please show me how to fix this fragment so it will compile and run in a console application
Cstring stuff;
for( i = 0, i < 80; i++ )
stuff += char(i);
Console::Writeline( stuff );
Thanks for your time
|
|
|
|
|
You're mixing up stuff here.
CString is an MFC/ATL class and Console::WriteLine is a .Net C++/CLI method.
I'm guessing you're using MFC, in which case you cannot use Console::WriteLine .
Use printf instead like this - printf("%s", stuff);
If you're doing a UNICODE build you must must either use wprintf instead of printf or use printf like so - printf("%S", stuff);
|
|
|
|
|
Yes, I know it does not work. That's why I'm here. Lets try again:
<unknown> show_stuff;
for( i = 0; i < 80; i++)
show_stuff[0] = <some_function>( i );
Console::Writeline( show_stuff );
Please correct my errors and re-write into something that will compile with C++ in a Visual Studio 2008 console application.
Thanks for your time
|
|
|
|
|
char show_stuff[80];
for (int i = 0; i < 80; ++i)
show_stuff[i] = i;
printf("%s\n", show_stuff); This will not give you the desired output as some elements of the array are data that cannot he printed.
|
|
|
|
|
I was hoping to find something more up to date than just an array of bytes. But I'll forget that and forget the CONSOLE::Write() options and just use the concept of:
char some_str[80];
int index = 0;
int low = (int)'A';
int high = (int) 'z';
for( int i = 50; i< 110; i ++ )
{
if( i >= low && i <= high )
some_str[index] = (char) i;
else
some_str[index] = '.';
index ++;
}
some_str[ index ] = 0;
printf( "data: %s", some_str );
Thanks for your time
|
|
|
|
|
You are asking in the wrong forum: C/C++/MFC is for native code. Your code snippet use the .NET Framework then the right forum is Managet C++/CLI
|
|
|
|
|
is this the fastest way to access the RGB values of a pixel of a bitmap file in c#?
the code is below
bm is previously declared Bitmap object.
Collapse
BitmapData bmd=bm.LockBits(new Rectangle(0, 0, 10, 10), System.Drawing.Imaging.ImageLockMode.ReadOnly, bm.PixelFormat);
int PixelSize=4;
for(int y=0; y<bmd.Height; y++)
{
byte* row=(byte *)bmd.Scan0+(y*bmd.Stride);
for(int x=0; x<bmd.Width; x++)
{
row[x*PixelSize]=255;
}
}
OR is there more faster way exists to access the RGB values of a pixel in C# or in VC++?
if in VC++ we can access the RGB values more faster than this so please help me.
and if the above method is the fastest way and no other faster method exists than this in c# or in VC++ so please comment as well.
thanks
|
|
|
|
|
That is the fastest way, as you access directly to the raw data of the image. Anyway, be aware that you are assuming the bitmap to be 32 bpp; you code will not work properly with 24 bpp, 16 bpp, 8 bpp, grayscale and B/W bitmaps.
|
|
|
|