|
I forget the details, but it's possible to get a call stack in code, I believe.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You could always use the Stack for this. Try looking at the StackFrame class for this.
|
|
|
|
|
I am on my way towards building my own "Automated Call Distribution", IF any has any clue for CTI or TAPI in .net 2.0 please let me know.
Thank you!
M. Nauman Yousuf
"Mess with the Best, Die like the rest"
|
|
|
|
|
Im writing a windows service in c# vs2003 that does a lot of io on file
reading files writeing files and more the problem is
the performance of the program is not so good
1. can some opne direct me to material about io best practices
2. is there free tools to analyse the code so i can track the problematic portion of the code
thanks
|
|
|
|
|
How are you using the IO? Do you have any code? IO will be slower in a managed context compared to a C memory-mapped file but I have never really had much of a problem with file IO in C#.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I need in-depth WorkFlow Foundation DependencyProperty samples, articles or explanations,
(for creation state workflow , whose activities are connectable to external .NET objects, WinForm's controls, arrays or DataRows in DataTable .)
Are there in-depth samples for DependencyProperty ?
thanks you
_______________________________
something I have:
http://odetocode.com/Blogs/scott/archive/2006/07/27/5444.aspx
DependencyProperty Activity binding
http://www.masteringbiztalk.com/blogs/jon/PermaLink,guid,0fae3e73-7801-4cf6-a5a5-9370b0f99973.aspx
is that the configuration mapping will control what page is next in the flow,
http://blog.hackedbrain.com/articles/UnderstandingDependencyObjectAndDependencyProperty.aspx
Ramblings from a compromised
|
|
|
|
|
I'm trying to run a web application inside a webbrowser component and I get java runtime errors, Those erros doesn't append when running into internet explorer 7.
The c# application I created is simply a window with a webbrowser in it, nothing else.
Jackd
|
|
|
|
|
I have installed an application on several xp machines. They all seem to be working fine.
Except one machine which has windows 2000. The application works but it is slow and sometimes it gives the following error:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Please note that in sql server 2005 Local and Remote connections is selected using tcpip
Any thoughts why only this machines sometimes gives this error when connecting to the sql server 2005 please?
Thanks
|
|
|
|
|
Try updating the MDAC components to the latest. YOu can get that here[^].
|
|
|
|
|
Hi all,
Can anyone tell me what happens (in the stack context) to the value type "x" after Init() method has been terminated:
--------------------
delegate void TestDelegate(ref int x);
class Program
{
static void Main(string[] args)
{
Init();
Console.WriteLine("Waiting");
Console.Read();
}
static void Init()
{
int x = 123;
int y = 123;
int z = 123;
TestDelegate t = new TestDelegate(TestFunc);
t.BeginInvoke(ref x, null, null);
}
static void TestFunc(ref int x)
{
Thread.Sleep(1000);
Console.WriteLine(x);
}
}
--------------------
Thanks,
________________________________________________________________
There are 10 kind of people: those who knows binary and those who doesn't.
|
|
|
|
|
|
Thanks!
Looking at the article, I figure out that passing int ref parameter (like Figure 13 example) will cause the value to be boxed - if the value is assigned to a object field - or simply copied - if the value is assigned to a int field - just like my example does.
Just assign some another value to "i" after BeginInvoke call and it will not affect the result.
The question is: Does the delegate class created has a "int" type or an "object" type to hold the value?
________________________________________________________________
There are 10 kind of people: those who knows binary and those who doesn't.
modified on Wednesday, December 05, 2007 2:44:19 PM
|
|
|
|
|
I'm trying to use P/Invoke to marshal some legacy code. I either get an "Entry Point Not Found" error, or a "Memory access violation"
I've run dumpbin on this dll, and i've verified that the entry point exists. I'm lost.
Here's the source for the function I'm exporting..
extern "C" BOOL FindUser2(char *cpUserFile,
char *cpPassword,
char *cpUserName,
char *cpUserPriveledge,
char *cpUserID,
char *cpComments,
BOOL *bUserActive,
char *cpErrorReason)
{...}
Here's my pathetic attempt to marshal it.
[DllImport("WN_USER_SECURITY.dll",EntryPoint="FindUser2") ]
public static extern bool FindUser2(
[MarshalAs(UnmanagedType.LPArray)]char[] strFileName,
[MarshalAs(UnmanagedType.LPArray)]char[] strUserPassword,
[MarshalAs(UnmanagedType.LPArray)]char[] strUserName,
[MarshalAs(UnmanagedType.LPArray)]char[] strUserPriveledge,
[MarshalAs(UnmanagedType.LPArray)]char[] strUserID,
[MarshalAs(UnmanagedType.LPArray)]char[] strUserComments,
[MarshalAs(UnmanagedType.Bool)] bool bUserActive,
[MarshalAs(UnmanagedType.LPArray)]char[] strErrorReason);
|
|
|
|
|
Try marshalling your char[] as StringBuilder objects instead.
|
|
|
|
|
Hi
first, as pete pointed out already it's a good idea to pass the char* with a string builder.
second, the BOOL *bUserActive looks to me like a ref value. so you might have to change your call as follows:
[DllImport("WN_USER_SECURITY.dll",EntryPoint="FindUser2") ]
public static extern bool FindUser2(
StringBuilder strFileName,
StringBuilder strUserPassword,
StringBuilder strUserName,
StringBuilder strUserPriveledge,
StringBuilder strUserID,
StringBuilder strUserComments,
[In,Out ]ref bool bUserActive,
StringBuilder strErrorReason);
it might work without the marshalAs Attributes because on "normal" datatypes, the clr automatically marshals the data correctly.
hope this helps
m@u
|
|
|
|
|
Well, I still can't get past the "Entry point not found" exception. I've examined the DLL using dumpbin and Dependency Walker, and they both show the entry point "FindUser2" as existing at ordinal 1. For some reason the C# app just wont see it.
|
|
|
|
|
Did you get the exception in application run or in method calling?
________________________________________________________________
There are 10 kind of people: those who knows binary and those who doesn't.
|
|
|
|
|
The exception occurs when I try to call the method.
|
|
|
|
|
Dio22 wrote: The exception occurs when I try to call the method
So the function is there. Maybe you´re checking another dll.
________________________________________________________________
There are 10 kind of people: those who knows binary and those who doesn't.
|
|
|
|
|
Hi,
here are some suggestions:
1.
make sure there is only one WN_USER_SECURITY.dll file.
Maybe you are looking at one file with dumpbin, but your app is looking at another (older) one,
hidden in the Windows PATH somewhere.
2.
Does the app find other methods in the DLL?
does another app work fine with that DLL?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
hmm.. i'm not a c++ guru, but i once wrote a little c++ demo lib that was callable from c# and i'm not sure if this is important, and if you can do anything about it but:
1) in my method-declaration i used the stdCall keyword:
void __stdcall foo(unsigned int *param1, unsigned char *param2, unsigned char *param3, void *Handle)
--> i think the default calling convention for pInvoked Method is stdCall so if it's not declared that way it might fail..
2) in the exports.def of the library i had to put this in order to make it work:
EXPORTS<br />
foo @1
--> if this is missing, it might explain the EntrypointNotFound - exception
greets
m@u
|
|
|
|
|
Hello friends,
I hope this is the right forum to place this question, if it isn't, please apologize me.
I'm thinking in taking the C# certification examinations and I need some help finding the right book or documentation to study.
If any of you did it before, perhaps can give a hand telling me the books you used so I can buy it.
Thanks a lot.
|
|
|
|
|
|
|
Thanks for all your answers. Help very appreciated.
I will check them and get the book.
pd: Any other opinion is welcome.
|
|
|
|