|
In the future, please start a new thread for new questions.
No, I do not have any experience with them, but you could find lots of information using a simple search[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I am trying to load the item list array in dll. I have created few dll (they have different item list in each dll).
The main program has two combo box. I would make a selection on the first combo box. Then the dll (the name based on first combo box text) will obtain the string array from the dll and automatically populate the second combo box.
I understand that I would use "late binding on native dll" method.
So is the idea of getting string array from dll possible?
|
|
|
|
|
Search this site for "plug-ins" for good articles about a similar topic, but keep in mind you can't even declare a string array in a DLL. You would have to declare it as a member of a class, either an instance or static field or property. To make this easy - if the strings are constact - declare it as a static variable using the same property name in a class with the same namespace and class name, then you could easily do something like this:
public string[] LoadArray(string path)
{
Assembly asm = Assembly.LoadFrom(path);
Type t = asm.GetType("Loader");
FieldInfo field = t.GetField("Strings");
return (String[])field.GetValue(null);
} This is a very simplistic example with no error handling so expect exceptions to be thrown. Be sure to read the documentation for the classes and members used for more information.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello:
I have a C# project which contains a web form, which has a button calling a web page containing a crystalreportviewer, which contains a CrystalReport report; when I call this page through Response.Redirect("WebForm2.aspx"); WebForm2 is not opening, instead it is sending me an error: [Null]Reference Exception: Reference to object does not stated as object's instance.]
Somebody know what is reason of this error?
I'll thank you for your help.
A.L.
|
|
|
|
|
can anybody write a code for me to explain wats so special about a foreach loop compared to a for loop.
uni1985
|
|
|
|
|
I don't think your instructor would like that at all. Why don't you try researching it a bit.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
I think that the question would not be wholly unfounded if he is just looking ahead a bit.
In other words, maybe he is clever enough to see there is no difference at all as opposed to not understanding either. (Actually writing code though, that is a bit over the top).
uni1985 - The difference between the two is negligible. When given an array, the foreach loop is used to iterate through all of the elements of a given type. You could do something identical with the for loop. Its just more convienent.
Jim
|
|
|
|
|
Esmo2000 wrote:
I think that the question would not be wholly unfounded if he is just looking ahead a bit.
You may be right. But experience has taught me otherwise.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Hi
Just to add one more point to what Eiso is already told. While navigating through a collection using foreach loop we cant modify the collection. Where as we can do that while using for loop.
Thanks
SGS
|
|
|
|
|
i am a beginner at this and hav been given a exercise to do to test if a word is a palindrome. a palindrome is a word that is spelt the same reversed.eg.madam,mom,dad etc.how would you go about doing it.
uni1985
|
|
|
|
|
Homework is not a palindrome.
BTW, what word have you been asked to test with?
Chris Meech
I am Canadian. [heard in a local bar]
Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
Hi,
Reverse the string and compare it with the original. If they match, then the word is a palindrome.
Regards
Senthil
|
|
|
|
|
this should get you started
public bool IsPalidrome( string strWord )<br />
{<br />
string upperString = strWord.Trim().ToUpper();<br />
for ( int x = 0; x < (upperString.Length / 2); x++ )<br />
{<br />
if ( upperString[x] != upperString[upperString.Length - x - 1] )<br />
return false;<br />
}<br />
return true;<br />
}
Don't just copy and use, figure out what is going on, or you'll never learn the basics of what you need to know.
- DougW48
dwright@tdci.com
|
|
|
|
|
i have created a client server application. after installing the deployed client application, it cannot connect to the server. but it could connect when ran using the solution. do i need to add anything to the deployment project to make it work? what could be the problem?
|
|
|
|
|
myname01 wrote:
what could be the problem?
Many things. In your solution, did you connect to your server using localhost or an IP address? If so, make sure that IP address is now the address of the server.
Also, when talking to applications across machine boundaries, which is what I assume you're doing, things like firewalls often come into play. If your client application connects to the server on a specified port, make sure that the firewall on both the client and server have that port opened. This is true for both software firewalls, such as Windows XP Firewall, and hardware firewalls, such as a router. If your client is connecting to a server within the same LAN as the client, then only software firewalls will apply.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Hi All
I have the wierdest problem with Crystal Reports for Visual Studio.Net 2003.
I wrote a report, to be displayed in the Crystal Reports viewer from within my C#.Net component. It worked fine. I then went and modified the report (minor formatting changes, put a title in, etc), and now I can't get the friggin' thing to update! I've copied and re-copied the new report file over, but when I generate the report from within my app, it still shows the old one!
I am NOT building the report into the assembly ("Build Action" -> "None"), so I'm sure that's not the problem. Either that or it's building anyway. Funny thing though is that I've REBUILT the assembly and it's still the wrong report! I've checked it in the designer, and my changes are there, but the old report is still displaying when I generate it from my app. Sorry I can't think of any other way to describe the problem (I've searched the 'net flat and found nothing relevant - I guess if I COULD think of a better way to describe my problem I might've found something <g>).
Any ideas or code?
--------------------------------------------------------------------------------
|
|
|
|
|
Hi All
I have the wierdest problem with Crystal Reports for Visual Studio.Net 2003.
I wrote a report, to be displayed in the Crystal Reports viewer from within my Visual Basic.Net component. It worked fine. I then went and modified the report (minor formatting changes, put a title in, etc), and now I can't get the friggin' thing to update! I've copied and re-copied the new report file over, but when I generate the report from within my app, it still shows the old one!
I am NOT building the report into the assembly ("Build Action" -> "None"), so I'm sure that's not the problem. Either that or it's building anyway. Funny thing though is that I've REBUILT the assembly and it's still the wrong report! I've checked it in the designer, and my changes are there, but the old report is still displaying when I generate it from my app. Sorry I can't think of any other way to describe the problem (I've searched the 'net flat and found nothing relevant - I guess if I COULD think of a better way to describe my problem I might've found something <g>).
Any ideas?
P.S. Also sorry I couldn't find a more appropriate forum for this thread. It doesn't relate to VB, as I'm sure the problem would be exactly the same from a C# app. Therefore, it doesn't relate to C# either.
--------------------------------------------------------------------------------
He is lawful good, not lawful stupid
|
|
|
|
|
My first suggestion would be to delete the old file and don't copy the new one over.
Then if your app still shows a report, it obviously is looking in a different location to the one you are updating.
Second question,
How are you loaded the report? Is it via code or did you do it all in the form designer?
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
When i delete the file it doesn't show up meaning it sees the right file.
Answer to the second question:
I'm using the form designer to load my report instead of code.
|
|
|
|
|
Hi guys,
I can't find this anywhere on the web after googling for hours, so the first person with the correct answer will be awarded the title of "Genius".
Here's my problem: I'm doing some late binding in C# with PowerPoint (automation). I can call methods and get/set properties using Type.InvokeMember, for example:
returnObject = instance.GetType().InvokeMember(methodName, BindingFlags.InvokeMethod, null, instance, parameters);
That works just fine. But how do I subscribe to and handle events that are fired from a PowerPoint object using late binding? Can I use InvokeMethod and pass in a delegate? I have no idea.
Thanks in advance, you guys are the greatest!
Andy
|
|
|
|
|
You can subscribe to events through the same code you had posted. Look for add_XXX and remove_XXX methods, the compiler calls them for you when you use the += and -= operators.
Regards
Senthil
|
|
|
|
|
Hi,
I am planning to write a software which reads proxy servers from a txt file and connecting a site through a proxy server and clicking a link on the site. Can somebody draw a roadway to this software. I have C# experience but I don't know which subjects handled with this project???
Thank you,
Cem
|
|
|
|
|
Hi,
I have a byte array (guid) which I would like to represent as a string containing hexadecimal values.
(eg. 'A0FFE7...')
I have tried the System.Uri.HexEscape function which does calculates the correct values, but a '%' is set before each hexvalue (thus: %A0%FF%E7...) Trying to remove the '%' failed (probably because of some internal representation).
Is there a way how I can get the required result?
(I've looked in a guid object as wel, but couldn't find anything.)
tnx.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
If it's a GUID, simply call ToString(), that should do the job for you.
Regards
Senthil
|
|
|
|
|
Actually the byte[] is the GUID out of the database (no idea how they created it) In order to use this guid for queries I need the string representation of the bytes in hexadecimal form.
I did try the guid.ToString() both it didn't work.
Any other idea?
(if all else fails I can always go to the old fashion table .
tnx.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|