|
(UPDATED)
Hi all,
I have a problem I can't seem to resolve. Im not 100% certain the C# forums are the right place to post this, sorry if that is the case. It's kind of a crossover problem.
I would be really grateful with any tips how to resolve my strange problem.
Problem context:
OS: Windows 2000 Server - IIS 6.0 - .NET framework 1.1
I wish to call a Web Service from an ASP page (VBScript). The Web Service is Document/Literal based (WSDL generated by JBoss App Server) so the good old MS SOAP Client 3.0 doesn't cut it. My solution: Create a c#/.NET DLL accessing the Web Service, make it COM interoperable and let the ASP call it using standard Server.CreateObject.
Well - everything works. Or worked. I created the C# class and followed a guide how to make the COM interoperability work. If I call the DLL from a stand-alone VB6 app or a C# console application, everything works as a charm - the web service is invoked and everyone is happy.
Problem: When I call it from the ASP script, I get a:
Microsoft VBScript runtime error '800a01ae'
Class doesn't support Automation: 'stub.updateContact'
The most strange is that it actually worked for perhaps 5 or 6 times. Then I got intermittent error messages about the Automation thing, but after that I get the same one every time.
I've cleaned the registry, recompiled the DLL numberous times, rebooted the server, triple checked the WSDL. Nothing helps. And - it always work when I access the "updateContact" function from a stand-alone VB6 or C# application.
It seems as the IIS is spooked.
I've debugged the whole thing so far I know the updateContact method will execute successfully if I out-comment all WSDL-proxy class related lines of code and simply let the method return a string. However - any instanciation of the proxy classes will trigger this error. The error does not seem to be "catchable" using try{..}catch(){..} clauses either.
I've googled a whole lot before posting this without any success.
Thanks for any help.
UPDATE:
It seems as I managed to solve the problem. By accident I suddenly got a command through when testing some other indata to the C# function. The data is actually a number of parameters, retrieved from a database. The ASP page asks for the ID of the table row, retrives the ResultSet and so on. Well - somehow the C# goes nuts when one or more of the indata parameters were NULL in the database. If I corrected the null ones in the DB, it works.
The test apps I used just sent static (non-null) data into the function which explains why it worked for those all the time.
-- modified at 10:46 Thursday 3rd August, 2006
|
|
|
|
|
My code:
object o = null;
object zoom = (object)50; // %
WebBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_ZOOM, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref o, ref zoom);
But this code don't work. Help me please.
|
|
|
|
|
Hi,
I have two generic Lists of data and I want to compare the values.
Fill the mappinglist we want to compare the sourcelist with
<br />
List<MappingItem> MappingList = new List<MappingItem>();<br />
MappingList.Add(new MappingItem("11", "1"));<br />
MappingList.Add(new MappingItem("22", "2"));<br />
MappingList.Add(new MappingItem("44", "4"));<br />
MappingList.Add(new MappingItem("55", "5"));<br />
Fill the Sourcelist we want to deal with
<br />
List<SourceItem> SourceList = new List<SourceItem>();<br />
SourceList.Add(new SourceItem("11", "Value one"));<br />
SourceList.Add(new SourceItem("22", "Value two"));<br />
SourceList.Add(new SourceItem("33", "Value three"));<br />
SourceList.Add(new SourceItem("44", "Value four"));<br />
SourceList.Add(new SourceItem("55", "Value five"));<br />
Make a instance of the DestinationList and the Itemobject
<br />
List<DestinationItem> DestinationList = new List<DestinationItem>(); <br />
DestinationItem destItem;<br />
Here is the problem Im stuck with. How shall I compare the values between these lists in a high performance way och with nice methods?
This is a uncomplete way, maybe u have a better method but I hope you understand what Im looking for!?!
<br />
<br />
foreach (MappingItem mappItem in MappingList.FindAll(new Predicate<MappingItem>(???)))<br />
{<br />
destItem = new DestinationItem(mappItem.DestId,"?SourceItem.Value?");<br />
DestinationList.Add(destItem);<br />
}<br />
<br />
Write the output
<br />
DestinationList.ForEach(delegate(DestinationItem d)<br />
{ Console.WriteLine("DestId: {0}, Value: {1}", d.DestId, d.Value); });<br />
Output result:
DestId: 1, DestValue: value one
DestId: 2, DestValue: value two
DestId: 4, DestValue: value four
DestId: 5, DestValue: value five
I hope I make my self clear
//Albin
|
|
|
|
|
abnorm wrote: I hope I make my self clear
I wouldn't get your hopes up.
What exactly are you trying to accomplish here? Are you trying to merge two lists into one new list? Are the lists that you are merging sorted or not? Does the new list need to be sorted?
If your original two lists are sorted it should be fairly easy to merge them together by starting at the begining of both lists and comparing the items from each list, then take the lowest (or highest, depending on which way you are sorting) and add it to your new list. Move to the next item in the list you took the item from and continue until you reach the end of both lists.
-- modified at 9:51 Wednesday 2nd August, 2006
Looking at your post again it looks like you are trying to take two list of different objects and match them based on one field (the 11,22,33 field) to create a new object that basically links them together. Is this correct?
If so, it should still be easy and is conceptually similar to merging lists. Sort both list first and compare the top two items. If they match then create your new object and add it to your final list. If not then move the lower of the two to the next item in the list and repeat until you reach the end of one of the lists.
Example, say you have these two lists
List A List B
11 11
22 22
33 44
44 55
55
You would do this: compare 11 from A with 11 from B. They match so you create your new object and put it into you final list. Then you move both lists onto the second item and compare 22 with 22. They match again so you create a new item and put it in the final list. Move both lists on and compare 33 with 44. These don't match so you don't create a new item, instead you move the list with the lower value on by one and compare 44 with 44. You have you match and you create a new item. Finally you compare 55 with 55, create a new item and you are done. Simple.
|
|
|
|
|
Well I understood your problem, but I don't know way are you doing that, but obviously you can't combine those lists "11", "1", "value one".
If the lists are sorted you can use a search algorithm. A simple one would be look for the middle element, compare it with the searched. If it bigger you search the first half of the list by comparing that middle element, otherwise you would take the second half and choose that middle element:
List 1 - 7, search value 7, in brackets is the visited Element:
1 2 3 (4) 5 6 7
5 (6) 7
(7)
You need just O(n log n) tests. You can sort it with Quicksort if the list is unsorted or use a BST (binary-search-tree) instead
Regards,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
ihoecken wrote: If the lists are sorted you can use a search algorithm.
If the intention is to go through the entire list and the list is already sorted, then using a search algorithm is a waste. Just start at the begining of both lists and interate through them.
|
|
|
|
|
Ok, but how? Please...
|
|
|
|
|
abnorm wrote: Ok, but how? Please...
See the end of my first post. I detailed the way I'd do it, all you have to do is write the code. The code's the easy part.
|
|
|
|
|
Wjousts wrote: If the intention is to go through the entire list and the list is already sorted, then using a search algorithm is a waste.
Oh, yes. I didn't thought that every element in those lists should be touched. It seems I didn't understood the problem.
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Well its easy to solve the problem in the head but more difficult (for me) to do it technical!!! So please if u have time to write some lines for me
|
|
|
|
|
Sorry. I can help you (or I could try) but I won't write code - if I write it you won't learn and if you need something again, I have to help again. But if you ask a question I will try to help you learn coding.
Regards,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
i need to draw a rectangle on the image of the picturebox control for that i used graphics drawrectangle method but it is not working properly can any body suggest other way or to use correctly the drawrectangle method
thanks in advance.
kalaveer.
|
|
|
|
|
kalaveer wrote: but it is not working properly
Define "not working properly".
Are you doing all your drawing in the Paint event?
|
|
|
|
|
What was wrong ?
I just use pictureBox and use the event Paint from pictureBox.
private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.DrawRectangle(new Pen(Brushes.Red, 2), 5, 5, 100, 100);
}
|
|
|
|
|
At the end of the day I shut down all my programs and then lock my computer. At around 7:00pm I have a sheduled task that runs a c# windows application. I want to add a feature to this application, that will enable it to retrieve e-mails that meet a certain criteria. The problem I am having is that once the computer is locked the program will attempt to run but will not be able to login to Outlook to retrieve the e-mails. The program is getting stuck because Outlook is asking for a Profile Name. This program runs perfectly when the computer is not locked (Outlook is also closed). Here is a sample of my code:
oApp = new Outlook.Application();
oNameSpace = oApp.GetNamespace("MAPI");
oNameSpace.Logon(null, null, true, true);
//For the above line I have even entered in my username and password
oInboxFolder =
oNameSpace.GetDefaultFolder (Outlook.OlDefaultFolders.olFolderInbox);
//The rest of the code is simply matching the criteria.
Any help in this matter would be greatly appreciated.
Thanks
Matt
|
|
|
|
|
You call "Logon" without a profile name, so Outlook tries to load the profile of the interactive user. This usually works fine, when the computer is LOCKED. It cannot work, if it is LOGGED OFF. So stay logged on to your workstation and only lock the desktop with WindowsKey+L.
Another solution would be to provide profile name and password, to start the Outlook session with the right profile. Store the password in an encrypted file to protect it from other users...
|
|
|
|
|
I have tried to logon without using a profile and it would not let me. I also tried to give it a profile name and password and again it gave me the same error. If you have done this before successfully could you post a sample of the code you used. Thanks for your time.
Matt
|
|
|
|
|
Hi guys,
I need some help, in my C# application, I am saving some settings in the registry; how do I uninstall those settings when the application is uninstalled?
Please help
sasa
|
|
|
|
|
Just a suggestion: You could set a bunch of default values for the registry keys in your install. Your C# application will override them. Then the uninstaller will pull out the registry values it created.
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
Thats a good idea; I will do that. Thanks. I still need help with deleting registry settings during uninstall though. Please help
sasa
|
|
|
|
|
I figured it out, you can do it in your setup project by going into registry properties. You can ask it to create during install, delete during uninstall, etc.
sasa
|
|
|
|
|
Hi, I created a control derived from ContainerControl and including two ComboBoxes.
When this control is put on a TabPage I execute this.BackColor = Parent.BackColor when the ParentChanged event fires. It works but the color doesnt match the parent's color. I can clearly see my controls outlines.
I don't understand why is there a difference.
|
|
|
|
|
hi all,
i placed a tabcontrol on my form. but i want to open tabs with button clicks.
so what i want is to learn how to hide or erase tabpage headers ?
this image http://link.imgshare.us/82jVCE tells what i exactly want.
help me please.
thanks in advance,
bye.
ps: there may be other ways to do this but i dont know
i want to place some buttons on the left hand side of the form and with each button click, i want to open something different (different pages) on the right hand side of that form.
i though that it can be done by tabcontrol...
i will appreciate your helps if you inform me whether there is other ways to do what i want or not?
|
|
|
|
|
You may want to consider ditching the tab control altogether and simply showing the appropriate UserControl in response to a button click.
/ravi
|
|
|
|
|
if u have allready added the tabpages to tab control at design time
then u can remove the tabpages at the time of lloading form
tabControl1.TabPages.Clear();
then on button click event u can add tab pages by this way
TabPage tb1 = new TabPage("XYZ");
tabControl1.TabPages.Add(tb1);
rahul
|
|
|
|