Question about converting int from C#

  • Thread starter Thread starter Deleted member 22320
  • Start date Start date
D

Deleted member 22320

Guest
i am trying to convert a snippet of code i found but it has a ton of errors after converting. I thing i can probably go thru and fxi most of them just by comparison but theres one but i dont understand.

When I convert this C# line:
Code:
private const int WM_GRAPHNOTIFY	= 0x00008001;
private const int WS_CHILD		= 0x40000000;
private const int WS_CLIPCHILDREN	= 0x02000000;
private const int WS_CLIPSIBLINGS	= 0x04000000;

I get this and it doesnt like it:
Code:
  Private const  WM_GRAPHNOTIFY as Integer = 0x00008001  
  Private const  WS_CHILD as Integer = 0x40000000 
  Private const  WS_CLIPCHILDREN as Integer = 0x02000000
  Private const  WS_CLIPSIBLINGS as Integer = 0x04000000

I know really next to nothing about C, so some of this confuses me.
 
Ok i think i got this sorted. But I'm still curious for anyone who knows....

The converter i used had a hard time converting some of the IF statments.. i'm guessing because the person used operators such as |, ||, and &&

I have no idea what these mean, but looking at the context they were in and at the same time just trying to make the errors go away i converted them to this

| into AND
|| into OR
and && also into AND

Am i anywhere near correct?



Oh, and as for the aforementioned question, heres what I tried(and I guess it works, havent seen any real bugs yet)

I can the C# project that had all the HEX crap, like the 0x04whatever, and then broke into debugging and hovered the mouse over it and it gave me a (large) integer value. I then loaded up trusty CALC and converted it to HEX.

then I set the number = &H(result)

again, is this correct?

After all this mucking in c# (and not knowing my from a hole in the ground) by brain's about to reboot.
 
Yes, constants defined as 0xvalue in C are equivalent to &Hvalue in VB.

| is a bitwise OR operator in C, used to combine values. The VB equivalent is Or.
|| is a logical operator, the VB equivalent is also Or (behaviour depends on context)
&& is logical And in both.
 
Cool, thanx divil. I'm slowly learning. found this nice converter and since this one actually converts stuff (hehe) i can figure it out for the most part.
 
Back
Top