I figured it out. I was using the correct API call, I just needed to specify the fully qualified AD server name.
I was passing just 'LDAP://mydomain' for ADsPath which worked on computers already connected because it would automatically search for it using some AD service.
I needed to be passing 'LDAP://myADserver.mydo main.org' which now works on all computers.
User Profile
Collapse
-
Active Directory Authentication from computer NOT on domain
Is it possible to authenticate an AD user from a computer that is not on the domain?
Currently I use the API ADsOpenObject to authenticate users, But on a computer that is not on the domain, I get 'Domain Not Found'.
Is there another API call I can make from a computer that is not on the domain that would allow me to authenticate? -
Here is a simple example:
Code:[DefaultEvent("ue_preclick")] public class CustomButton : Button { public delegate void ue_postclick_handler(EventArgs e); public event ue_postclick_handler ue_postclick; public delegate void ue_preclick_handler(CancelEventArgs e); public event ue_preclick_handler ue_preclick; public delegate void ue_click_handler(EventArgs e);
Leave a comment:
-
Thats exactly what i was looking for. Lol..i felt crazy that i couldnt find it. The site mentioned above shows exactly that....Leave a comment:
-
No no, this was purely for design time. The double clicking is done inside of visual studio.
For example, I (as a developer) drop my custom button on the form, then I double click it to goto the code behind of the form. VS automatically adds the click event for me. By putting the DefaultEvent attribute at the top of a custom control class, you can choose what event is automatically added by visual studio.
Edit: ...Leave a comment:
-
Garr..jumped the gun again..
System.Componen tModel.DefaultE ventLeave a comment:
-
Leave a comment:
-
Add event through IDE (VS2008 C#)
This may be a silly question, but how can one add an event through the IDE?
i.e. I place a button on the form design time..double click it automatically adds the click event for me. How do I add another event say..VisibleCha nged?
Usually I would edit Form1.Designer. cs myself, but for less experienced programmers it could get a little confusing (i.e. VS would overwrite changes if not done properly) -
Design Time double click code
I have a custom button class that inherits from 'System.Windows .Forms.Button' and i want to change the default behavior during design time when it is double clicked. i.e. when a developer doubleclicks the button it should add code for a custom event rather than the normal click event.
Any ideas? -
Well i cant really figure it out..
The function I call is defined as "int GetWords(char** * slst);"
Though i just figured out my problem (blindly troubleshooting and playing)
I changed:
Code:*(lst[i])
Code:(*lst)[i]
Thanks!Leave a comment:
-
Char***
Im having trouble in the c++ world grasping char arrays.
Im given a char*** from a thrid party function and i want to loop through the returned strings and just message box them.
This is what i have:
Code:char ***lst; ll_cnt = GetWords(lst); for(int i = 0; i < ll_cnt; i++) { MessageBox(0, str, *(lst[i]), 0); }
-
One..the question was about passing arrays from c# to c++ and back..not memory checking and error proofing..that is something do be done after I figured out the problem at hand.. Two..reading the material that you gave (after digging further around in to find something that remotly addressed the issue at hand [http://msdn.microsoft.com/en-us/library/hk9wyw21.aspx]) makes the same assumption about strings (Im gonna go ahead and take MSDN's word on...Leave a comment:
-
Problem solved with this:
c++
Code:__declspec(dllexport) int __stdcall Test(LPCTSTR ** as_test) { _tcscpy((wchar_t*)as_test[0], TEXT("a result.")); return 3; }
Code:[DllImportAttribute("PBNI.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)] public static extern void Test([In, Out] String[] as_test);
Leave a comment:
-
Taking the array element out of the picture everything works as expected. I'm getting results, just not what im asking for. I need to return an edited array parameter..
Passing the array of strings, in the c++ code I am able to messagebox(0, as_test[any index], L"", 0) and see that each string is indeed there. So the pointer in is working.
I think i will end up turning the array into a delemited string but...Leave a comment:
-
I've gotten a step closer by changing the c++ code to this..
Code:__declspec(dllexport) int __stdcall Test(LPCWSTR * &as_test) { _tcscpy((wchar_t*)as_test[0], L"new data"); return 0; }
Leave a comment:
-
Thanks for the post, just gave it a try but still getting the same results :(Leave a comment:
-
DLL export array reference to C#
I am trying to pass a string array from c# into c++ and manipulate the data of that array. How can I do this? (I am c++ newb)
c++
Code:__declspec(dllexport) int __stdcall Test(LPCTSTR* as_test) { as_test[0] = L"This is new data"; return 0; }
Code:[DllImport("PBNI.dll", CharSet = CharSet.Unicode)] static extern int Test(ref String[]
-
just tried using
Code://catch //Wants a try.. //{ //CryptDecrypt(lp_key, 0, 1, 0, ref ls_temp, ref lul_length) //} try { CryptDecrypt(lp_key, 0, 1, 0, ref ls_temp, ref lul_length) } catch { }
Im pretty sure I've got the right datatypes there..
http://msdn.microsoft. com/en-us/library/a...Leave a comment:
-
Its been implemented in an older application that it needs to be compatible with and I dont know how to translate the above into the .NET equalvalentLeave a comment:
-
CryptDecrypt 'System.ExecutionEngineException'
Hi!
I'm having a problem calling CryptDecrypt from .Net.
Even thoug I call from inside a try catch block execution stops on the call with error "Exception of type 'System.Executi onEngineExcepti on' was thrown." with no extra information after that..
Has anyone run into a problem like this before?
Code:[DllImport("advapi32.dll", EntryPoint = "CryptAcquireContextW",
No activity results to display
Show More
Leave a comment: