|
Hi Gurus!
I created a web application in C# but when I created a new Setup project and add all files and outputs I desired I got a wariing massage when I selecting Build->Batch build->Rebuild all. The warning messge is
"Unable to build folder named Admin"
So does any of you knows what's happening? Please give some solution to build my setup project...
Thanx.
xedom developers team
|
|
|
|
|
I pick off this topic because I found solution here
http://www.dotnet247.com/247reference/msgs/48/244282.aspx
xedom developers team
|
|
|
|
|
in my C# app, i want to import somefuntions from win32 dll.
look like this:
[Dllimport("own.dll")]
public static extern void function();
then use the function().
i want to get the own.dll 's handle like LoadLibrary("own.dll") in VC++.
but HOW ?
and if i import 2 or more functions from defferent win32 dll, HOw to get their
handles respectivly ?
and last question: HOW to free the DLL like FreeLibrary do ?
|
|
|
|
|
fu0 wrote:
i want to get the own.dll 's handle like LoadLibrary("own.dll") in VC++.
but HOW ?
[DllImport("kernel32.dll", CharSet=CharSet.Auto)]
static extern IntPtr LoadLibrary(string lpFileName);
[DllImport("unmanaged.dll")]
static extern int YourFunction(int i);
string path = @"..\somedir\own.dll";
IntPtr ptr = LoadLibrary(path);
int i = YourFunction(7);
In .NET 2.0 you will be able to do this:
[DllImport("kernel32.dll")]
internal static extern IntPtr LoadLibrary(String dllname);
[DllImport("kernel32.dll")]
internal static extern IntPtr GetProcAddress(IntPtr hModule, String procname);
internal delegate int MyMsgBox(IntPtr hwnd, [MarshalAs(UnmanagedType.LPWStr)]String text, [MarshalAs(UnmanagedType.LPWStr)]String Caption, int type);
IntPtr user32 = LoadLibrary("user32.dll");
IntPtr procaddr = GetProcAddress(user32, "MessageBoxW");
MyMsgBox msgbox = (MyMsgBox)Marshal.GetDelegateForFunctionPointer(procaddr, typeof(MyMsgBox));
msgbox(IntPtr.Zero, "Hello, World", "A Test Run", 0);
- Nick Parker My Blog | My Articles
|
|
|
|
|
THanks for your suggestion!!
|
|
|
|
|
hello,
I have created a dynamic textbox in an asp.net and fill the value dynamically. But the value doesn't show up on the page. I think system has overwrite the value on my dynamic textbox.
I tried to trace the textbox. But couldn't do it. Can anyone give me the best way to trace the textbox. or if I can set a break point for my dynamic textbox.
any suggestion will be appreciated.
Thanks, Suds
======
You need a head to program. Cool, fast and sharp.
|
|
|
|
|
|
sorry!
======
You need a head to program. Cool, fast and sharp.
|
|
|
|
|
how to use COM which written by visual c++ ATL?
|
|
|
|
|
|
how can i disable the task manager from my program
|
|
|
|
|
You can do it thought the registry. Or, I guess you could mess around with the taskman executable in the sys dir or somewhere...
/\ |_ E X E GG
|
|
|
|
|
But, the real question is: Is that really all that wise?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Do I have to answer?
/\ |_ E X E GG
|
|
|
|
|
You can take the fifth if you want to. It is your constitutional right.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
My windows service is working fine in WinXP SP1, but it can't start in Win2K Server SP4. The error message is: "The service did not respond to the start or control request in a timely fashion."
Any idea?
Thanks
|
|
|
|
|
That's a very generic error message for any service that can't start. I recommend you set the AutoLog property to true and check the event log (eventvwr.exe) for more detailed information.
It may be that you're using functionality only supported in XP and newer, but without more information it is impossible to determine.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
AutoLog is set to true. Another message that I get from EventViewer is "Timeout (3000 ms) waiting for the service to connect".
I do not use any XP specific function. In fact, my OnStart() and OnStop() are empty.
Thanks for your response.
|
|
|
|
|
You might explain what your service does, then. Like I said - any service (native, .NET, VB, whatever) will report that (it's actually the service control manager (SCM)) when any error occurs. It expects that the service itself will report additional information in the event viewer (like it should).
If you link against other assemblies (besides the .NET BCL assemblies), make sure they are in the same path, in the GAC, or in a path configured in your service's .config file. Read How the Runtime Locates Assemblies[^] in the .NET Framework SDK for more information about how assemblies are located.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Just be clear, I am talking about "Windows service" not "web service."
|
|
|
|
|
Web.config is what ASP.NET uses. Windows applications that are launched by the executable loader use the "appname.exe.config" file-naming convention. It's all about what sets up the default AppDomain, loads the AppDomainSetup , and loads and executes the target assembly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Can anyone tell me how to perform a hit test on a GDI Region from a mouse point ?
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
[DllImport("gdi32.dll")]
static extern bool RectInRegion(IntPtr hrgn, ref RECT lprc);
Just convert your point to a RECT first.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Just in case you're using .NET's GDI+
(assuming you have a Region r)
<br />
bool hit = r.IsVisible(new Point(x, y))<br />
Just look up the IsVisible(...) method on MSDN.
|
|
|
|