|
Hi there
In the MSDN i read that the Timeout property from the WebRequest class isn't available when using the asynchronus way. When i try to webrequest a uri which doesnt exists, the program hangs a couple of seconds before throwing an exception. If the main part of the uri exists but e.g. the path is incorrect, then ill get an error response right after.
How to reduce the hang/timeout when webrequesting an uri which doesn't exist? Any ideas?
--------------------
Thanks for reading
|
|
|
|
|
i just created a NT service project with the help of Service Project Template given in VS,and installed it by using installutil servicename.exe
however its not appearing in Service Panels,here are contents i see on console window
Beginning the Install phase of the installation.
See the contents of the log file for the c:\windowsservice1\windowsservice1\bin\
debug\windowsservice1.exe assembly's progress.
The file is located at c:\windowsservice1\windowsservice1\bin\debug\windowsservi
ce1.InstallLog.
Installing assembly 'c:\windowsservice1\windowsservice1\bin\debug\windowsservice
1.exe'.
Affected parameters are:
assemblypath = c:\windowsservice1\windowsservice1\bin\debug\windowsservice1.e
xe
logfile = c:\windowsservice1\windowsservice1\bin\debug\windowsservice1.Instal
lLog
No public installers with the RunInstallerAttribute.Yes attribute could be found
in the c:\windowsservice1\windowsservice1\bin\debug\windowsservice1.exe assembl
y.
The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the c:\windowsservice1\windowsservice1\bin\
debug\windowsservice1.exe assembly's progress.
The file is located at c:\windowsservice1\windowsservice1\bin\debug\windowsservi
ce1.InstallLog.
Committing assembly 'c:\windowsservice1\windowsservice1\bin\debug\windowsservice
1.exe'.
Affected parameters are:
assemblypath = c:\windowsservice1\windowsservice1\bin\debug\windowsservice1.e
xe
logfile = c:\windowsservice1\windowsservice1\bin\debug\windowsservice1.Instal
lLog
No public installers with the RunInstallerAttribute.Yes attribute could be found
in the c:\windowsservice1\windowsservice1\bin\debug\windowsservice1.exe assembl
y.
Remove InstallState file because there are no installers.
The Commit phase completed successfully.
any help?because i dont think there is some mistake in code or calling methods
Thanks
MyBlogs
http://weblogs.com.pk/kadnan
|
|
|
|
|
Hi,
The key portion of the error message is this:
<br />
No public installers with the RunInstallerAttribute.Yes attribute could be found in the c:\windowsservice1\windowsservice1\bin\debug\windowsservice1.exe assembly.
This means that you don't have a ServiceInstaller with the [RunInstaller] attribute set to yes. Check your code to see if that is missing completely, or if it's just needs a little tweak. (And look up ServiceInstaller in the docs if you haven't already.)
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
I have dataset which is binded to datagrid and dateformating is done based on culture. This happens fine with out any problem.
If my dataset is retrieved as a xml string using dataset.GetXML then converted to dataset and binded to datagrid. The date formatting wont take place instead it displays in the following format
2005-02-09T14:13:24.8280000-00:00.
But I want the dateformatting to take place on datagrid in either of the case.
Padvit
|
|
|
|
|
Hi, i want to open a word document in an existing class including the below code.
.........
.........
object fileName = strFileName;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
oDoc = oWordApplic.Documents.Open(ref fileName, ref missing,ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible,ref missing,ref missing,ref missing, ref missing);
oDoc.Activate();
It works fine in my computer which includes Office 2003, but if I try to run this code in another computer which includes Office 2002 it gives the following error:
Error-->"System.Exception: object reference not set to an instance of an object.
this error occurs in the line of oDoc = oWordApplic.Documents.Open(..) .
Can anybody help me please.
Fatih Sen
|
|
|
|
|
Hi!
The type libraries for different Word versions are not compatible.
You should program against the lowest version number, i.e. get yourself a primary interop assembly of Word97 and use only the objects defined there.
That way your program should work with Word97 and up.
If you really need objects/functionality from later Word versions, then you will have to pick the prim. interop assembly for this version, but your program will not work with a lower Word version.
Regards,
mav
|
|
|
|
|
I used Microsoft Office 11.0 Object Library. So, should I use lower version like Mic. Off. 10.0 Library. Do you mean that?
Fatih Sen
|
|
|
|
|
|
Hi again mav.
I changed the Microsoft.Office 11.0 Object Library with Microsoft.Office 10.0 Object Library. And now it gives the following error:
System.Exception:System.Runtime.InteropServices.COMException. There is insufficient memory.Save the document now at Microsoft.Office.Interop.Word.Documents.Open(....)
Do you know why this situation occurs now?
Fatih Sen
|
|
|
|
|
Now it works. After changing from Microsoft.Office 11.0 Object Library with Microsoft.Office 10.0 Object Library I got the above error. Then,start>run>dcomcng. Clicking the Microsoft Word Document , in the Identity I changed the user to "interactive user".
Thanks mav.
Fatih Sen
|
|
|
|
|
I have a report ex:
ReportDocument report=new ReportDocument();
report.Load("path to the report);
DataSet dataSet=new DataSet();
I have a connection to a database SqlConnection...,
SqlDataAdapter adapter=new SqlDataAdapter("Select * From database Where x='y'",connection);
adapter.Fill(dataSet);
report.SetDataSource(dataSet);
crystalReportViewer.ReportSource=report;
and when I run the report not returns the date what I said in sql,he return all the rows from table.
Please help me.
|
|
|
|
|
Did you save your data with "Save Data With Report"?
Is the query valid? Check what the query returns. Hope this will help.
<italic>Work hard, Work effectively.
|
|
|
|
|
Yes the query is valid,I verify the dataSet and he has the dates what I want,but I didn't save data with "Save Data With Report".
|
|
|
|
|
Hi guys!
I have written a set of functions that interacts with a modem. The functions works fine when I call them from a ordinary machinecode compiled c program. Now to the problem. Just for fun, I have put my functions in a dll and intend to call them from a c# app.
I have successfully called unmanaged functions that takes null terminated strings (char*) as parameters from my c# app. I used Marshal.StringToHGlobalAnsi that returns a IntPtr for that.
To call unmanaged functions that returns null terminated strings I have read that I should use pointers i an unsafe context. My test function returns char* and I call the function from code that is marked unsafe.
The function call i the c# app
<br />
unsafe public String callUnsafe()<br />
{<br />
char* resp = do_READ_FROM_OPENTCPSOCKET(comdev);<br />
return new String(resp);<br />
}<br />
The function prototype i the c# app
<br />
[DllImport("dll.dll", CharSet=CharSet.Unicode)]<br />
private static extern char* do_READ_FROM_OPENTCPSOCKET(Int32 comdev);<br />
The function prototype in the unmanaged dll
<br />
extern "C" { <br />
char* DLLDIR do_READ_FROM_OPENTCPSOCKET(HANDLE comdev);<br />
}<br />
The code compiles fine, but when I run it all I get is a EntryPointNotFoundException.
Has anyone tried this before?
Maybe someone has some codesnippets that they can share.
thanks in advance!
/Mike
|
|
|
|
|
Have you tried it the simple way, yet? The CLR provides marshalling capabilities for you, so you don't have to worry about calls to Marshal.StringToHGlobalAnsi() when things are set up well.
<br />
[DllImport("dll.dll", CharSet=CharSet.Ascii)]<br />
private static extern string do_READ_FROM_OPENTCPSOCKET(Int32 comdev);<br />
<br />
Give this a shot, and forget about using "unsafe" when you try it. For additionaly help in the interop area, try watching this[^].
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Thx, I will give it a try!
|
|
|
|
|
For some odd reason I still get a EntryPointNotFoundException when I try to invoke an unmanaged function that returns char*. Could it be something dodgy with my unmanaged dll?
|
|
|
|
|
I am attempting to write a C++ DLL function that will return a string and then call that function from C#. Looks like you have working code that does this or something very similar. Could you show what you did to make this work?
Here is the relevant portion of my code:
In C++ DLL header (.h)
extern "C" __declspec(dllexport) int addfive(int x);
extern "C" __declspec(dllexport) char* putFolderList();
In C++ DLL source (.cpp)
int addfive(int i) { return i+5 ;}
char* putFolderList(){ return "my string" ;}
In C#:
using System.Runtime.InteropServices;
[DllImport("DLLBuildTest.dll")]
static extern int addfive(int x); // VALID
static extern char* putFolderList(); // NOT Valid
Paul
|
|
|
|
|
HI all,
How one can impliment this idea using wmsdk9 series,
do u have any code which can help me.
well i have created a player object and if trying its full screen property its run only first time , but as the media file ends it comes in normal mode.
private AxMicrosoft.MediaPlayer.Interop.AxWindowsMediaPlayer axWindowsMediaPlayer1;
//axWindowsMediaPlayer1.fullScreen=true; gives error
Querry--
how can we retain in full screen mode for all play list or repeat.?
Regards,
Lalit Narayan Dubey
|
|
|
|
|
How nice of you to repost your question from your previous thread just because it dropped a few lines on your screen.
And good that you simply quoted your last statement from that thread instead of giving additional information that might help others to solve your problem.
Outstanding!
Cheers
Sid
P.S.: If you find me sarcastic, cynic or ironic - you are on the right track.
|
|
|
|
|
In .Net why is string is treated as reference type, it is a primitive datatype. All premitive datatype are value type except string why this is. Is there any spl reason.
Regards,
Chakravarthy.v
|
|
|
|
|
I'd say it's because strings can get very large. The maximum size of other primitive data types is predefined, but strings can grow to arbitrary lengths. You certainly wouldn't want to copy a 100,000 characters long string everytime you pass it to a function (by default) or put it in a collection (boxing).
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
System.String is a reference type and not a value type, which means each string is allocated on the heap and not the stack. System.String is peculiar in that it has a shortcut keyword associated with it (string), which is a common practice with primitive value types - System.Int32 (int), System.Char (char) etc. String references also do not require the new keyword to allocate an instance, the following line of code will allocate space on the heap, fill it with string data and assign the reference to the variable:
A string is a sequential collection of Unicode characters, typically used to represent text, while a String is a sequential collection of System.Char objects that represents a string. The value of the String is the content of the sequential collection, and the value is immutable.
The ANSI string class implements a first-class character string data type that avoids many problems associated with simple character arrays
vimsy
|
|
|
|
|
i have seen that to boost performance in a crc class, the code prefetch data in a byte[] of lets say 16384.
i've seen that
public FileStream(
string path, FileMode mode, FileAccess access, FileShare share,
int bufferSize
);
has its own buffer, so if i set the bufferSize to 16384 and use the FileStream.Readbyte
i could achieve the same performance but it is not.
What is this bufferSize for?
example code
http://www.vbaccelerator.com/home/NET/Code/Libraries/CRC32/Crc32_zip_CRC32_CRC32_cs.asp
|
|
|
|