Hey guys, I have a WCF data service that works well with an Internet application I developed (using Forms authentication). Now I'm trying to create a WPF desktop application that uses this same data service and does its own custom authentication. The problem is my WCF data service always sees Membership.GetUser() as null. I've tried calling Membership.ValidateUser() within both the WPF application and the WCF data service with no luck. What am I missing, what am I doing wrong? Thank you, David
David Moody
Posts
-
WCF authentication -
How to remove system menu from MDI child form??I have an MDI child form. When the user uses the arrow keys to go between main menu items they can get to both the child forms system menu and the parent forms system menu. How do I delete/remove the child forms system menu? I've tried the ControlBox property but that doesn't work (VB.NET bug?). I've also tried deleting all the items in the system menu using API calls but that still leaves the little icon. Thanks so much for any help. I've looked everywhere but can't seem to find anything.
-
ThreadingTry this: Catch ex As ThreadAbortException Trace.WriteLine("READ THREAD ABORT EXCEPTION!") 'Allow the thread to continue aborting: Thread.ResetAbort() david
-
Very frustrating dllimport code..Thank you for your help. I tried lots of different combinations using the MarshalAs attribute. I eventually ended up pinning (__pin) and assigning my Byte array to an IntPtr in the struct. That worked great! david
-
Delegate not working...Hey guys, I'm trying to get a callback function to work from my unmanaged C++ dll. Everytime I run my program I get System.NullReferenceException saying "Object reference not set to an instance of an object." in mscorlib. This error is thrown when the runtime tries to execute the callback function in my unmanaged C++ DLL. What I'm trying to do is real simple and straightforward: namespace ProtocolDll { __delegate void MY_CALLBACK(); [DllImport("test.dll")] extern "C" void UnmanagedFunc(MY_CALLBACK __gc* myCallback); public __gc class Wrapper { public: void myCallback() { MY_CALLBACK* cb = new MY_CALLBACK(this,&Wrapper::CallMePlease); UnmanagedFunc(cb); // Call the unmanaged dll function } void CallMePlease() { Int32 i=0; i=i+1; // I put a breakpoint here but it never makes it }; } ************************************ Here is my unmanaged C++ dll code: typedef void (*MY_CALLBACK)(); EXPORT void UnmanagedFunc(MY_CALLBACK* pfnCallback); void UnmanagedFunc(MY_CALLBACK* pfnCallback) { (*pfnCallback)(); } Any idea what I am doing wrong? Thanks for any help... this is my last issue with this unmanaged dllimport stuff... this code is a bear to write. david
-
Very frustrating dllimport code..I'm trying to call a C dll function passing a structure that looks like this: typedef struct { long lModuleID; DWORD dwAddress; long lType; BOOL fComplete; long lLength; BYTE *pbyData; WORD wTimeoutMS; long lErrors; } MEMACCESS_STRUCT_S; I translate this into the following structure in my managed C++ code: [StructLayout(LayoutKind::Sequential)] public __gc class MEMACCESS_STRUCT_S { public: Int32 devAddr; Int32 memAddr; // DWORD (UInt32) Int32 type; Int16 complete; // BOOL -> TRUE=1, FALSE=0 Int32 length; Byte data[]; Int16 timeout; // WORD (UInt16) Int32 err; }; Everything works great except the variable "data" that holds the byte array. I get garbage when I look at the values for the array. What am I doing wrong? Thank you so much for any help... I'm nearing the point of headbutting my monitor and throwing my mouse out the window over this one! david
-
.NET and DLL callbacksCouple of thoughts: 1) Try using windows messaging instead of callbacks. Windows messaging is much more efficient and optimized by the OS. 2) Try offloading the callback to another thread. As for Delphi, I've never used it. What is your busload on the CAN network you're trying to read everything from and what speed are you running (250, 500, 1M, etc)? I can tell you that nearing 70-100% busload on a 250k CAN network will make a boat anchor out of my PC, if it tries to process all the data. Not to mention you are trying to record it... which requires flushing to a file every now and then. David
-
.NET and DLL callbacksMatt is right, do you really need all of that data? Are you using RP1210A? If so, filter out what you don't need at the driver/dll layer and don't allow all of the data to come up. CAN is a very fast protocol and on a loaded bus can bring almost any computer to its knees if it tries to process every message. david