Chad,
>Just out of
>curiosity, is there a setting some where to change this default behavior?
If you set CharSet=CharSet.Unicode in the DllImport attribute on the
function, the default for all string parameters becomes LPWSTR. And
CharSet.Auto => LPTSTR.
Mattias
===
Mattias Sjögren
[EMAIL P
I didn't try your parameters below, but one thing for sure is that when
using the string for the LPWSTR*, you must use the [MarshalAs
(UnmanagedType.LPWStr)] attribute in the declaration on the string. If you
don't, the string will only contain the first character. This is because
the default ma
Pierre is right and in these instances, sometimes it helps to look at
the IL generated:
Here's a simple class with both a const and a static readonly:
using System;
public class Testcctor
{
const int this_is_const = 6;
public static readonly int this_is_sro =5;
public v
Chad,
In this case "[MarshalAs(UnmanagedType.LPWStr)] ref/out string" will work,
because the runtime frees the string memory with CoTaskMemFree() by
default, and FindMimeFromData() allocates it with CoTaskMemAlloc().
If you for some reason want to use an IntPtr parameter instead, free the
mem
Chad,
Have you tried the following definition? You shouldn't need to worry
about memory management at all--that's Interop's job. You also
shouldn't need to declare the exact type, as the types should be
automatically mapped as listed in the MSDN docs[1]. I'm also pretty
sure that the
[DllImpo
Kevin,
Basically, your LicenseProvider can be called when context.UsageMode is
Runtime or Designtime. At designtime, you want to be grabbing the
license key from a text file/registry entry. At runtime, you want to
grab it from the compiled assembly that is calling your control.
When the licenses
I am calling the FindMimeFromData in urlmon and I want to make sure I don't
have any memory leaks on the unmanaged side. I have two versions of the
call, one using a ref IntPtr and one using a [MarshalAs
(UnmanagedType.LPWStr)] ref string to represent the LPWSTR*. My hunch is
the latter "Marshal
(Thanks to Mattias for answering my last question)
Hi,
I've implemented my own LicenseProvider and License for my component.
This bit works fine; it grabs the key from the registry and saves it.
However, obviously, in order for it to save it, I need a licenses.licx
file in the hosting applicatio
Thomas, the web service invocation is async (by default) so the webservice
component could partially process the call and then effect an efficient
system wait on an event without blocking the client. I'm obviously assuming
here that the webservice component is multithreaded.
Cleanup issues under
Ross Diesel suggested...
> I would use a WebServices behaviour, which is a reusable DHTML
component
> that uses Web Services by communicating over HTTP using SOAP...
Using the WebServices/SOAP method your'e suggesting looses the
asynchronous notification (Server -> Browser) capabilites Giri is
Hello,
I'm using the Windows .NET 2003 Enterprise NLB service in conjunction with
the out of process session management service.
I'm not certain why, but when I try to hit a test page on one of the host
boxes it crashes!
I'm using IIS 6.0 Worker Process Isolation Mode with an application pool
a
...and to answer myself again, change the following line:
System.Reflection.ParameterModifier pm =
new System.Reflection.ParameterModifier( tempArgs.Length );
to this so it will handle COM calls without arguments:
System.Reflection.ParameterModifier pm =
12 matches
Mail list logo