|
Is there some utility that can compile my project by just using .sln file? So, something small that can compile whole solutions by just using csc.exe along is what I'm looking for...
Am I asking too much?
Thanks for any comment or link to helpful web page...
|
|
|
|
|
http://nant.sourceforge.net/[^] is a command line tool, but it will do what your are looking for.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
I used the 'Handle' property of Form class to pass the window handle of my form to a winapi function, namely, 'WTOpen' used for opening a tablet context (present in wintab32.dll). This function returns a handle to the opened context. The problem is that this function is not opening a context (returning 0). I have imported the unmanaged function in the following way:
[DllImport("wintab32.dll")] public static extern HCTX WTOpen(IntPtr hWnd, ref LOGCONTEXT lpLogCtx, bool fEnable);
where HCTX is of type IntPtr.
The function prototype is as follows:
HCTX WTOpen(hWnd, lpLogCtx, fEnable)
where hWnd -- HWND Identifies the window that owns the tablet context, and receives messages from the context.
lpLogCtx -- LPLOGCONTEXT Points to an application-provided LOGCONTEXT data structure describing the context to be opened.
fEnable -- BOOL Specifies whether the new context will immediately begin processing input data.
It will be highly appreciated if someone could point out where i've made a mistake.... Thanku.
Nadir Khan
|
|
|
|
|
First, I think your import should look more like this:
[DllImport("wintab32.dll")] public static extern IntPtr WTOpen( IntPtr hWnd, ref LOGCONTEXT lpLogCtx, bool fEnable );
Second, there could very well be a problem with your structure definition, LOGCONTEXT. We'll need to see your code for that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you for showing concern. I would really appreciate it if you could finally solve my problem.
I have defined the LOGCONTEXT structure as follows:
[ StructLayout( LayoutKind.Sequential, CharSet = CharSet.Auto )]
public struct LOGCONTEXT
{
[ MarshalAs( UnmanagedType.ByValTStr, SizeConst = 40 )]
public string lcName;
public uint lcOptions;
public uint lcStatus;
public uint lcLocks;
public uint lcMsgBase;
public uint lcDevice;
public uint lcPktRate;
public uint lcPktData;
public uint lcPktMode;
public uint lcMoveMask;
public uint lcBtnDnMask;
public uint lcBtnUpMask;
public int lcInOrgX;
public int lcInOrgY;
public int lcInOrgZ;
public int lcInExtX;
public int lcInExtY;
public int lcInExtZ;
public int lcOutOrgX;
public int lcOutOrgY;
public int lcOutOrgZ;
public int lcOutExtX;
public int lcOutExtY;
public int lcOutExtZ;
public uint lcSensX;
public uint lcSensY;
public uint lcSensZ;
public int lcSysMode;
public int lcSysOrgX;
public int lcSysOrgY;
public int lcSysExtX;
public int lcSysExtY;
public uint lcSysSensX;
public uint lcSysSensY;
}
Its actual form is as follows:
#define LC_NAMELEN 40
typedef struct tagLOGCONTEXT {
TCHAR lcName[LC_NAMELEN];
UINT lcOptions;
UINT lcStatus;
UINT lcLocks;
UINT lcMsgBase;
UINT lcDevice;
UINT lcPktRate;
WTPKT lcPktData;
WTPKT lcPktMode;
WTPKT lcMoveMask;
DWORD lcBtnDnMask;
DWORD lcBtnUpMask;
LONG lcInOrgX;
LONG lcInOrgY;
LONG lcInOrgZ;
LONG lcInExtX;
LONG lcInExtY;
LONG lcInExtZ;
LONG lcOutOrgX;
LONG lcOutOrgY;
LONG lcOutOrgZ;
LONG lcOutExtX;
LONG lcOutExtY;
LONG lcOutExtZ;
FIX32 lcSensX;
FIX32 lcSensY;
FIX32 lcSensZ;
BOOL lcSysMode;
int lcSysOrgX;
int lcSysOrgY;
int lcSysExtX;
int lcSysExtY;
FIX32 lcSysSensX;
FIX32 lcSysSensY;
} LOGCONTEXT;
There is another function;
UINT WTInfo(wCategory, nIndex, lpOutput)
wCategory--UINT Identifies the category from which information is being requested.
nIndex--UINT Identifies which information is being requested from within the category.
lpOutput--LPVOID Points to a buffer to hold the requested information.
I pass an object of LOGCONTEXT as reference to it. It works fine and fills up the object with specific values then when I pass the object to the other function (WTOpen) it fails to work. Hope u can come up with something. Take care.
|
|
|
|
|
This is code from Wine! A Win32 emulation library for Linux. God only knows what FIX32 and WTPKT types really are. Have fun with this one, this is as far as I can take it. There was a mistake near the bottom, lcSysMode is listed as a BOOL type and you had it as an integer.
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto )]
public struct LOGCONTEXT
{
[ MarshalAs( UnmanagedType.ByValTStr, SizeConst = 40 )] public string lcName;
public uint lcOptions;
public uint lcStatus;
public uint lcLocks;
public uint lcMsgBase;
public uint lcDevice;
public uint lcPktRate;
public uint lcPktData;
public uint lcPktMode;
public uint lcMoveMask;
public int lcBtnDnMask;
public int lcBtnUpMask;
public int lcInOrgX;
public int lcInOrgY;
public int lcInOrgZ;
public int lcInExtX;
public int lcInExtY;
public int lcInExtZ;
public int lcOutOrgX;
public int lcOutOrgY;
public int lcOutOrgZ;
public int lcOutExtX;
public int lcOutExtY;
public int lcOutExtZ;
public uint lcSensX;
public uint lcSensY;
public uint lcSensZ;
public bool lcSysMode;
public int lcSysOrgX;
public int lcSysOrgY;
public int lcSysExtX;
public int lcSysExtY;
public uint lcSysSensX;
public uint lcSysSensY;
}
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank u very much for ur help. I managed to solve the problem by trial and error. I actually removed the "StructLayout Attribute" from top of the structure which solved the problem. Anyways, ur help is duly appreciated. Could u give me a link to "Wine" so that I can see how they have defined the other structures in wintab. Thank u.
|
|
|
|
|
Try typeing "Wine Win32" into Yahoo or Google.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Why the hell does prefixing a number with 0 not change a number to octal? I ran into a problem where I'd defined a enum with what I thought were octal constants, but the compiler takes them as decimal?
Regards
Senthil
|
|
|
|
|
Your point being....? I take it your coming from a Java background?
Because octal literals are deprecated? And, I don't remember seeing any documentation that C# ever supported them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
My point being that C# being a language from C/C++/Java background, with the same syntax for representing hex numbers, should have had support for octal numbers. At least, the compiler should have given me a warning when I prefixed a 0..
Octal literals are available in C and C++, not just Java.
Octal literals deprecated? Why would they do that? I must admit I've never read the standard completely, but then, I didn't need to read the standard to know to prefix 0x for hex numbers either..
Regards
Senthil
|
|
|
|
|
Since C# does recognize Octal literals, prefixing a 0 just makes it a decimal number. The compiler won't generate a warning based on some other languages syntax rules.
Why? Because it's not used often enough to justify the expense of adding support for it? I don't know - ask Microsoft. They've removed Octal literals from their own JScript.NET too...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to scroll a text box using a label, don't ask why I just need to :P... How can I scroll the caret through the textbox so that I can use ScrollToCaret() ?
If this is impossible, is there a way to edit the scroll bar colors just for this program??
Thanks,
Sub
|
|
|
|
|
Use the TextBox SelectionStart property to put the caret at end the end of the text. You can then use ScrollToCaret() to make sure it's visible in the TextBox. There is a drawback to using ScrollToCaret though. The TextBox must have the focus in order for it to work.
TextBox1.SelectionStart = TextBox1.TextLength;
TextBox1.Focus();
TextBox1.ScrollToCaret();
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone know how i would i play wav sounds in my web forms?. I'd like to play the sound when the form loads and keep playing until i have moved to another form.
Thanks in advance,
Alexander
|
|
|
|
|
DirectShow/WindowsMediaPlayer, or there's a playsound API, I think, you can interop it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
or there's a playsound API, I think, you can interop it.
In a WEB form? I don't think so.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Oops - missed that bit...
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
You'll have to use HTML methods to do this. ASP.NET is a server-side technology that only generates HTML. It can't play a sound client-side using any method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I'm toying with reflection to try and build a recursive function that generates treenodes of a treeview that represent any given object's graph (of child objects):
public TreeNode BuildNode(ref object o)
{
TreeNode tn;
treenode.Tag = o;
treenode.Text = typeof(o).Name;
if (typeof(o).GetInterface("System.IEnumerable",true))
foreach (object c in o)
tn.Nodes.Add(BuildNode(ref c));
else
foreach(MemberInfo m in typeof(o).GetProperties(BindingFlags.Public))
tn.Add(BuildNode(ref m.???); // << Trouble here ...
// I really just want access
// to the property from the
// MemberInfo object...
return tn;
}
As you can see, it almost works except I have no way of accessing an [un?]boxed object's property. I know from reflecting the object's type that it has the property, but have no way of accessing the property (in a generic manner) without hardcoding my object types into a bunch of overloads of 'BuildNode', or having some way-huge switch.
Looking for advice, pointers to documents, creative ideas, etc. that might get me closer to a solution.
Thanks for all your help,
Rein
|
|
|
|
|
Hello all,
is there C# code that zip and unzip file
thank you
|
|
|
|
|
|
Maybe u are hell of a searcher then ^_^
|
|
|
|
|
Hi everybody.
There Is a way to change the initialization sequence in static constructors?
I have the following code:
<br />
class MyClass<br />
{<br />
static int a;<br />
static bool b = true;<br />
<br />
static MyClass()<br />
{<br />
a = 10;<br />
}<br />
}<br />
<br />
The compiler generates the following:
<br />
class MyClass<br />
{<br />
static int a;<br />
static bool b;<br />
<br />
static MyClass()<br />
{<br />
b = true;<br />
a = 10;<br />
}<br />
}<br />
I want that member a will be initialized before b does, but I must do it on runtime.
In other words, there is some parameter that tells the compiler to place the inline initializations in the end of the static constructor?
Thanks a lot,
Yaakov
|
|
|
|
|
No, there isn't. It looks like your going to have to design your code around this little problem and initialize the new instance of the class yourself instead of relying on the compiler to do it for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|