Events over LAN
Hi,
I'm developing a client / Server application that mainly comunicates via a
shared database and OPC server via DCOM.
But I need to fire events when a update is performed on the client or
server. If on of the clients is updating it should send an event to the
server, then the server would send events to all clients. The events don't
need to contain data.
What is the best way to do this when IIS and webservices are not an option ?
Tanks
Totto Tag: how to solve prblem Tag: 89567
Software shut down my PC, user authorization
Hi group,
I have a Test Bench, in a workshop. It is 'embedded' with Win2000. It have
to be automatically shut down at 05h00 PM.
It can be use by different user wich have 3 profiles (user, user with power,
admin).
I want to be able to shut down the PC at 5h.
- independantly of the user or user profile
- even if nobody is logged in (during the "enter your name and password"
screen of windows)
- even if the Test Bench App is not running.
- the PC have to be shut down properly (as if the user do a start>Shut down)
I have no idea i need some links, or pists. Full working solution are also
accepted :)
thank you all for your help.
ROM
www.maintag.com Tag: how to solve prblem Tag: 89564
TreeView Question
I am deriving my own TreeView control from the 1.0 Framework TreeView.
I have overriden the OnAfterSelect method and want to respond to selection
of a node.
The issue I am having is that if the user selects a node and then clicks the
node again, no OnAfterSelect event is triggered. I figure this is the way
it is supposed to work but would like to work around this.
Has anybody had this issue and found a way to work around it?
I thought I could monitor OnMouseUp events and see if the left mouse button
is clicked on the selected node and then call OnAfterSelect from with in
OnMouseUp.
This creates a new issue of when you actually do select another node, now
OnAfterSelect gets called twice (once for the select and once for the mouse
up event). Oh and in case your wondering, I'm pretty sure the OnAfterSelect
event is fired before the OnMouseUp event. A snipet of my code is shown
below:
protected override void OnAfterSelect(TreeViewEventArgs tvea)
{
base.OnAfterSelect(tvea);
...
do really cool stuff when node is selected!
...
}
protected override void OnMouseUp(MouseEventArgs mea)
{
base.OnMouseUp(mea);
if (mea.Button == MouseButtons.Left)
{
TreeNode node = GetNodeAt(mea.X, mea.Y);
if (node == this.SelectedNode)
{
OnAfterSelect(new TreeViewEventArgs(this.SelectedNode));
}
}
} Tag: how to solve prblem Tag: 89563
Usage of .net class lib in a windows service
Hi,
I'm developing a windows service with c#. Now I'm trying to use a .net class
library (dll) to include.
For this I added the dll to my references. But unfortunately if i run the
service i got always this error:
File or assembly name "myClassLibrary", or one of its dependencies, was not
found.
Does someone knows where i have to place my dll that it could be found by my
windows service.
I already tryied to place it in the System32 folder and also in the same
folder as the windows service is. But without any success. :(
Thank you for your help!
Best Regards,
Michael
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =--- Tag: how to solve prblem Tag: 89562
Apparent issues while using System.DateTime
In my application I store all transaction dates in UTC in the database.
At the time of displaying the transactions in the UI I convert the date to
local date time and then display the same to the user.
I do the following:
string LocalDtTimeString =
Convert.ToString(DtClass.ConvertToLocalDateTime(System.DateTime.Parse(strDate)));
where strDate is the string representation of the date fetched from the
database.
and the DtClass method implementation is:
public class DtClass
{
:
:
public static DateTime ConvertToLocalDateTime(DateTime UTCDateTime)
{
return UTCDateTime.ToLocalTime();
}
:
:
}
Scenario is:
My UI is in the context of PST. I perform a transaction at 4:30 PM (PST).
Database stores the date as next day morning 12:30 AM (UTC).
Now I changed the Time Zone of my machine from PST (GMT - 8) to
EST (GMT - 5).
I run my UI and see that it shows the transaction time as 10:30 PM (EST)
instead of showing it as 7:30 PM (EST).
This is happening on a test machine.
When I wrote this code and tested it on the development machine, it was
correctly converting times and giving respective local times.
Is there anything that I need to change in the code that will make it work
consistently on all machines?
I looked around regarding this issue on the internet and read some material,
which talks about behavior differences based on the culture notably with
DateTime.Parse and DateTime.ToString.
I don't understand why it subtracts 2 hours instead of 5...
I would really appreciate your help...
Thank you...
-Avinash Tag: how to solve prblem Tag: 89550
Help: Wrong build assembly file caused BadImageFormatException
I have a solution with multi projects (VB.Net), but sometimes the build
output of one project get a wrong file which caused BadImageFormatException
at run time.
When you open the wrong file with ildasm, you can find that same class
appears more than once.
My question is: what's wrong with my projects? How can I solve this problem
because now there is another project starting to build wrong output too.
Thanks in advance!
BTW: If I post in wrong place, please point me the correct one.
Henry Tag: how to solve prblem Tag: 89549
Array.Sort?
Can someone explain to me (as something of a .NET layman) why the Sort()
method of System.Array is static?
Is it because it's changing the array you're sorting? Is there some
limitation where if it was an instance method, it wouldn't be able to
reorder the array?
Just curious!
Cheers,
Matt Tag: how to solve prblem Tag: 89548
Overflow or Underflow in the arithmetic operation
I have wrote a program using vb.net v. 2002 and this program will send print
out to a printer Xerox Phaser 3120 model. My program is installed on a
Windows 98 client. My problem is when I try to send the print out to that
printer, I 'll get this error message "Overflow or Underflow in the
arithmetic operation" and error print out will be produced (printout with
this error message:
PCL6 ERROR - FALSE
POSITION : 0x50fe58 (5307992)
SYSTEM : WSIM/xl_pa_sim
LINE : 249
VERSION : QPDL 1.14 09-28-2002
How can I solve this problem ?
Thank you,
Chin Tag: how to solve prblem Tag: 89547
.NET Framework v1.1 SP1 locks PC up...
I ran the Windows Update in which it offered v1.1 SP1 of the framework. I
installed it and rebooted as required. When I came back into my pc, the
desktop appears frozen (I can't even bring up Task Manager). The bizarre
part of this problem, if I wait 15-20 minutes my PC will come back to life
and work as "normal".
I've done a google search and found several similar reported problems after
installing v1.1 SP1. Anyone hear had or having this same problem??
What is very strange is that v1.1. SP1 doesn't show up in Add/Remove
Programs?
thanks, Rob. Tag: how to solve prblem Tag: 89542
Connected Status on Sockets
I have created a socket application in C++.NET that connects in non-blocking
mode. All my previous apps of this kind have used blocking mode at the
connection, but in this case I did not want the app to wait if the server was
not available. In the course of doing this, I discovered after several
hours of frustration that the Connected property of the socket is not set in
non-blocking mode even after the connection is completed. Maybe this is
documented someplace, but I could not find it. Is this behavior to be
expected or have I got an error someplace else? I got around this by using
Poll instead to check for the connect status, but I would still like to know
why Connected is not working.
Thanks,
Bill Tag: how to solve prblem Tag: 89536
Postback form .NET bug
I am having a problem that I swore I read about a long time ago and it was a
.NET service-pack/hotfix bug.
The problem right now is that whenever I try to postback on form, it simply
does nothing. I distinctly remember the issue being fixed by a hotfix, but
I can't remember which one. I can't seem to find anything on google either.
Anyone remember this or have a link to a KB article?
I think it had something to do with the aspnet_client files directory and
where it was stored. Tag: how to solve prblem Tag: 89534
How can I know if I am in a Service or Application?
I have a c# component that can be used in various executables. I need a way
in the code of this component to determine if the executable that loaded it
is a Windows Service -or- a Console/Windows application? i.e. within the code
of this component how can I determine if the process that loaded it is a
Service or App? I am looking for a C# sample.... thanks! Tag: how to solve prblem Tag: 89530
Errors from Socket Functions
I am using C++.NET to build an application using sockets. I am connecting
to multiple servers, some of which may not always be available. I am setting
blocking off before connecting and using the poll command to detect when the
connection is complete. This works fine, but if there is an error, like
connection refused, I can't get the speicfic error. In the docs it says to
use GetLastWin32Error, but that always returns zero. In my past experience
with the function, I found that I had to use the DLLImport function to
activate the specifc API call. I feel that I must have to do something
similar in this case, but I don't know how to compose the DLLImprt to provide
this functionaltiy to the socket functions. Please let me know if I am
going down the right road, and what I need to do to make this work.
Thanks,
Bill Tag: how to solve prblem Tag: 89527
SP2 & "The Publisher could not be verified. Are you sure you want to run this software?"
Hello.
Our company has created a .Net application which the user starts by
executing via a URL (i.e., http://someserver/application.exe). On some
machines running Windows XP SP2, the user will see a dialog containing the
message "The Publisher could not be verified. Are you sure you want to run
this software." This does not happen on most machines running SP2, but it
does occur on a couple. And yet, the Security settings on the machines where
it does occur seems to be the same as on the machines where it doesn't
happen. Can anyone tell me how to turn this off?
Thanks. Tag: how to solve prblem Tag: 89524
hOW TO DO THAT IN .NET... FRAMEWORK?
I have wave files being recorded for interactive voice enabled application.
Currently I have more than 1000 wave files implemented in the application.
Since I have recorded using regular desktop PC the quality of the sound is
not good. Also the volume levels in each of the wave files are different.
So what is happening is when I play more than one file at time, end user
will hear some of the wave file in one pitch, some of them with different
volume level making it an unpleasant experience for the end user.
Is there any way using .Net application I can redit these wave file to bring
atleast volume level of these files to the same.
Do I have understood the file system where exactly the volume level is
stored in the wave file?
Your reply is highly appreciated.
Douz Tag: how to solve prblem Tag: 89520
MarshalAsAttribute()
Good Day
and Happy New Year to all of you!
I was wondering if we should trust the auto-marshalling done by the CLR or
not ?
i mean this works very fine :
'***
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Private Shared Function GetPrivateProfileString( _
ByVal lpAppName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
ByVal lpReturnedString As StringBuilder, _
ByVal nSize As Int32, _
ByVal lpFileName As String) As Int32
'
End Function
'***
is there any advantage to hardcode the marshaling type like this (except for
the fact that we got self-documented code) ?
'***
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Private Shared Function GetPrivateProfileString( _
<MarshalAs(UnmanagedType.LPTStr)> ByVal lpAppName As String, _
<MarshalAs(UnmanagedType.LPTStr)> ByVal lpKeyName As String, _
<MarshalAs(UnmanagedType.LPTStr)> ByVal lpDefault As String, _
<MarshalAs(UnmanagedType.LPTStr)> ByVal lpReturnedString As
StringBuilder, _
<MarshalAs(UnmanagedType.U2)> ByVal nSize As Int32, _
<MarshalAs(UnmanagedType.LPTStr)> ByVal lpFileName As String) As Int32
'
End Function
'***
also is there any garantee that the defaults auto-marshalling made by the
CLR changes over the next versions and makes our actual
non-explicitly-marshalled API declaration crash in the future ?
thanks a lot !
--
Best Regards
Yanick Tag: how to solve prblem Tag: 89517
Bug in reflection?
Is there a bug in reflection as follows?:
If I have a method in a class
[method:Obsolete]
public ReturnType RandomMethod()
{
// ...
}
and using reflection I get the MethodInfo for this method then call
MethodInfo.ReturnTypeCustomAttributes.GetCustomAttributes(false)
to get the custom attribute object list for the *return* type, the returned
array contains the *method* custom attribute object ObsoleteAttribute,
whereas it should actually be an empty array.
If I modify the method as follows (random example for demonstration)
[method:Obsolete]
[return:XmlIgnore]
public ReturnType RandomMethod()
{
// ...
}
then I correctly get the return type custom attribute array consisting of
one object, namely the XmlIgnoreAttribute. Tag: how to solve prblem Tag: 89509
Required fields, pointers and VB.net
Hi,
Given a set of objects like the following I have two questions - firstly
is the technique used below for initialising what are effectively constants
in Sub New() correct? Is there a "better" way of doing this? Secondly, I
know that the code below for Validate() , requiredProperties etc. will never
work - you can't put a reference to nothing into a collection. How could I
effect this - or similar functionality? What I really want to be able to do
is to put a bunch of pointers into an array and check in Validate() whether
they point to an instantiated object...
(The idea here being that I can abstract the logic for validating common
objects like these into a base class.)
Thanks,
Nick
Class Animal
Public MaxAge as int
Public TypeDescription as string
Public RequiredProperties as Collection
Public Sub Validate()
for each Obj as Object in RequiredProperties
if Obj is nothing then : throw new exception("Required property
not set :" & obj.tostring()
next Obj
End Sub
End Class
Class Dog : inherits Animal
Public sub new()
TypeDescription = "Dog's are a man's best friend"
maxage = "14"
end sub
Public CollarSize as integer
End Class
Class Cat : inherits Animal
Public Sub New()
TypeDescription = "Nasty animals - not even good for eating"
MaxAge = "18"
RequiredProperties.add(HasStupidBellAroundNeck)
end sub
Public HasStupidBellAroundNeck as boolean
End Class Tag: how to solve prblem Tag: 89500
Crystal Reports for .NET (VS 2003) limitations
Hi All,
I have been using Crystal Reports for .NET that ships with VS 2003 to
develop some reports that I plan to deploy as part of a web application.
I want to find out the limitations of this version of Crystal Reports. I did
read somewhere that it is not scalable. But, is there a concurrent user
limit? And, is that applicable in a web scenario where irrespective of who
is logged in the process accessing the report is same.
TIA Tag: how to solve prblem Tag: 89499
VB Studio 2005 and data access?
I'm using VS Studio 2005 beta with VB.NET. The beta doesn't allow accessing
data sources. I'm not sure what other limitations there may be. It seems
VS Studio 2003 .NET is the latest version. I've found the Pro version on
eBay to be just under $100. Is this a good price?
Also, will I "only" gain data source access with the paid version?
What are some differences in the 2005 and 2003 versions?
Thanks,
Brett Tag: how to solve prblem Tag: 89498
Can anyone provide an example of how to write/install an .NET "applet"
Folks:
I presume it's possible to write a browser-hosted .NET "applet" much
like you can write a J*va applet.
To get started, it would be nice to see some sort of "hello world"
application, and sample <OBJECT> tag to see how to get it all together.
Can anyone point me to the right place?
--
Skip Tag: how to solve prblem Tag: 89497
Threadpool and thread priority question
First question:
I have read that you cannot change the thread priority of a thread pool
thread. They always run at normal. Is this true?
Second question:
If I manage my own thread pool of thread objects, must the thread priority
be set before calling thread.start? Can the priority be changed on the fly
while the thread is running with thread.currentthread.priority?
Thanks Tag: how to solve prblem Tag: 89496
Repost: Silent install of .Net Framework
I am trying to install the .Net framework 1.1 without seeing any GUI and
specifically not seeing the licensing agreement. I am doing:
dotnetfx /q:a
It still asks me to agree to the licensing agreement.
Is it possible to install the framework silently and if so, what is the
command line?
Thanks.
STom Tag: how to solve prblem Tag: 89493
Microsoft Internet Controls: .net replacement ?
I am using Microsoft Internet Controls (com dll) to open up a web browser
with the address bar hidden and maximised. Is there a way I can do this with
the .net framework ?
Thanks,
Craig Tag: how to solve prblem Tag: 89485
Overload Indexer
Hallo,
could anyone explain why the double indexer ist called and not the
overloaded int indexer.
The Test Object is called with an int Value!
Output:
CALL Test this[double dbl] ??????????????
CALL Test this[int idx]
using System;
public class Test : TestBase
{
public override object this [int idx]
{
get {
Console.WriteLine("CALL Test this[int idx]");
return "Test[int]";
}
}
public object this[double dbl]
{
get {
Console.WriteLine("CALL Test this[double dbl]");
return "Test[double]";
}
}
public static void Main()
{
object obj;
Test tst = new Test();
int i = 2;
obj = tst[i];
obj = ((TestBase)tst)[i];
Console.ReadLine();
// Output
// CALL Test this[double dbl] ??????????????
// CALL Test this[int idx]
}
};
public class TestBase
{
public virtual object this[int idx]
{
get {
Console.WriteLine("CALL TestBase this[int idx]");
return "TestBase[int]";
}
}
};
Thanks
Dieter Tag: how to solve prblem Tag: 89484
Equivalent of SIO_UDP_CONNRESET in .NET
Hello all.
Is there an equivalent to setting socket option SIO_UDP_CONNRESET to
FALSE (ignore ICMP "port unreachable" messages when sending an UDP
datagram) in .NET socket class?
Thanks.
Arnaud Tag: how to solve prblem Tag: 89482
Advice for how to store data
I'm starting to develop an application similar to an address book, task
manager, etc.
I'm going to develop this using C#, but that doesn't matter, my problem is
another.
I need to store contacts, tasks and a few other similar things.
What do you recommend for storing this kind of data? XML files, Access
database, MSDE database... ?
Before starting I want to be sure I'm using the most efficient way.
Thanks in advance. Tag: how to solve prblem Tag: 89480
strange form behaviour...
I am busy with a program for my pocket pc. but since it is still compact
famework, I'll post this here too, because I'm very much in need for some
help with this:
I have one form which is my main form and has 4 option buttons and two
regular buttons, one for saving and the other for canceling the program.
When the user select an option button, a new form is opened and he can fill
in some fields by using a context menu (standard answers).
When he is finished, tapping on the save button, the form is hidden and the
user is returned to the main form, where an image is drawn that the form is
filled in and done.
After that the form is disposed
After the second button he chooses the third option, but the form of option
2 is show, by either tapping on save or cancel, the form is hidden/closed,
and the form that should have been displayed is opened.
When clicking on the save or cancel button, an exception error occurs, a
disposed exception.
The same thing happens when the second option is skipped and he goes first
to the third option and then the fourth.
Instead of showing the fourth, the third is shown and after closing it, a
disposed exception appears.
Basicly this is what is done:
a.. create instance of new form
b.. set the textboxes with text from dataset table
c.. show the form with showdialog
d.. dispose of the form when it returns
Nothing fancy, but with that strange error.
Who can help me with this?? Tag: how to solve prblem Tag: 89473
Appdomain
I am new to .net,
I want to know what is appdomain and process? how they are related.
how the .net framework executes the Windows application (C#) Tag: how to solve prblem Tag: 89471
Unable to start debugging on the web server
Hi, All:
When I tried to run a web project on the web server from my local machine, I
allways get this message:
"Error while trying to run project: Unable to start debugging on the web
server. The debugger is not properly installed. Run setup to install or
repair the debugger."
I checkecd web.config file, the debug set to true, and I am a member of
administration group.
Any Ideas? Tag: how to solve prblem Tag: 89462
Framework 1.0 application looking for 1.1 dll
I wrote a windows application in VB Dot Net 2002. So that's Framework 1.0
right?
It ran fine on several computers but then I tweaked it and rebuilt it and
now I have the following exception when the application starts
C:\Windows\Microsoft.Net\Framework\v1.1.4322\mscorwks.dll could not be
loaded.
The thing is on my development computer it does not give me the error. But
maybe the reason for is that at one time I had both 1.0 and 1.1 installed on
the development box.
I've looked through the dependencies and can't find any components that
needing anything from Framework 1.1 .
Help ! Anybody got any ideas?
Dan Tag: how to solve prblem Tag: 89461
Automatic startup of service
I built a service in visual studio 2003 for the 1.1 framework. I used the
wizard. For the most part this service works great, and has for several
months, except for when the service restarts. on a 2003 server the service
starts up fine. on a 2000 server I get an event log errors: There's
nothing really that this service does that takes longer than 30 seconds. I
can manually start this service no problem, but I need it to start when the
server starts.
The MyService service failed to start due to the following error:
The service did not respond to the start or control request in a timely
fashion.
Timeout (30000 milliseconds) waiting for the MyService service to connect. Tag: how to solve prblem Tag: 89455
Quick Questions on threading
I've been toying with threads the past couple days and I
was curious if anyone could answer a few basic questions.
1) I'd like to take a method call I make currently
successfully, and simply throw it into a new thread to run
until the method finishes, at which point in time the
thread would terminate.
What would be the best approach to do this. I dont ind
doing some reading... I tried to be resourcefull ahead of
time. Tag: how to solve prblem Tag: 89452
Interop & Reflection
Hi,
I try to create ObjectBrowser for some COM objects (C# project, I use
Interop Assembly for COM).
But if following code :
Type oType = m_Object.GetType();
always return __ComObject instead of <Interop Class>, is it any way to get
<Interop Class> ?
--
Thanks,
Maxim Tag: how to solve prblem Tag: 89447
Who is my calling object?
Hi everyone,
I am implementing I method where it would be convenient to get the instance
of the object that is calling me. I know I can get the calling method using
the StackFrame class, and I can get the calling assembly, but what about the
instance of the object which implements the calling method?
Thanks,
Bob L. Tag: how to solve prblem Tag: 89446
general question regarding when to abstract vs. interface
This is just a thought I wanted to put out there to get some opinions...
I've been programming for a number of years, but until a couple of years
ago, always with VB6, so everything I did to "fake" inheritance was done
with encapsulation. About two years ago, I began working with .NET and C#.
This question has bothered me for a while, but never enough to cause any
great concern in my work.
I just started designing a new project, and the question has popped up
again....
Can you think of a time where you would intentionally choose to use an
interface instead of an abstract, other than as a workaround for the lack
multiple inheritance support? Iss there any general rule or rule of thumb
or best practice that has been formulated that dictates when to use
interfaces vs. when to use abstract classes.
Thanks for any comments.
Trevor Tag: how to solve prblem Tag: 89443
Crystal Reports
Is there a way to populate a Cdystal Report object from a select statement
rather than selecting a table and field? Tag: how to solve prblem Tag: 89440
Proper place for custom CONFIG file
Hello,
We have a set of applications and assemblies that belong to one project.
Some of the configuration settings are supposed to be shared between various
assemblies on the same machine. After long discussions we finally decided
that the best alternative for us is to create a custom configuration file
<OutProject>.config and place it in a common directory. Then we can write
our own configuration parser that will return NameValueCollection settings.
There seems to be two good places to install such file:
<Windows>\Microsoft.NET\Framework\<CurrentVersion> and
<Windows>\Microsoft.NET\Framework\<CurrentVersion>\CONFIG. Both of them
contain several configuration files. My first impression was that the latter
one is the best (since it's called CONFIG), however it contains only system
specific configurations files like machine.config. All application-based
config files are located one level up, inside
<Windows>\Microsoft.NET\Framework\<CurrentVersion>.
Do you know what is the best practice?
Thanks
Vagif Abilov
Contopronto AS
Oslo Norway Tag: how to solve prblem Tag: 89439
Error 1937 on VS installation
Hi all.
I'm trying to instal the VS 2003 in a machine with Win XP SP2 and, at end of
the installation, I receive the follow error message:
ERROR: Error 1937.An error occurred during the installation of assembly
'Microsoft.mshtml,Version="7.0.3300.0",PublicKeyToken="b03f5f7f11d50a3a",Culture="neutral",FileVersion="7.0.3300.0"'.
The signature or catalog could not be verified or is not valid. HRESULT:
0x80131045.
May it be DVD problem? Or it be problems with Win XP? How can I solve this
problem? Before install the SP2 of Win XP, I was received the error 1935.
Thanks a lot
André Tag: how to solve prblem Tag: 89438
Custom control and Design patterns
Dear All:
I am working on building a huge system which has a ton of custom controls.
I am wondering if there are any .Net specific design patterns and practicies
that i should be using for these controls.
Thanks
Praveen Tag: how to solve prblem Tag: 89437
Enum conversion from an Object in VB.NET
Which statement gives better performance (where obj can contain any of the
CLR runtime types)
1) CType([Enum].Parse(GetType(UploadMode), tmp), UploadMode)
or
2) Me._mode = CType(tmp, UploadMode)
or
3) System.ComponentModel.TypeDescriptor.GetConverter(
GetType(UploadMode)).ConvertFromxxxx(tmp) Tag: how to solve prblem Tag: 89434
System.ComponentModel.Win32Exception: No mapping between account n
Hi!!!!
About a year ago I created a Windows Service using Microsoft's Visual
C++.NET. It works wonderfull and everything was fine.
Today I changed the service name (just the service name), and when I
try to install the new version I get the following error message:
An exception occurred during the Install phase.
System.ComponentModel.Win32Exception: No mapping between account names and
security IDs was done
No pre-requisites are missing since the old version installs just fine.
The only event that I think might have had a repercution is that I had
to format my developing machine a couple of months ago, reinstalling Windows
2003 server and Visual Studio 2003.NET. However, the old version gets
installed just fine, which means that all the required libraries are
installed.
Any help is greatelly appreciated!!!!!
Tarh ik Tag: how to solve prblem Tag: 89433
Exporting registry key to a reg file?
I've had a look around and AFAICT, the Microsoft.Win32.RegistryKey class
doesn't have any members that write the registry to a reg file. So, as I see
it, the options are:
1. Use Microsoft.Win32.RegistryKey to parse each value and write each to a
reg file manually. This is a bit of a pain as I have to write all the code
to keep the syntax of the resultant reg file correct.
2. Shell out and use regedit /e to export the file. Not ideal because when I
do this, I believe that a separate thread is used, so my app carries on
working whilst the registry is still being exported (noticeable for large
exports). OK, I could monitor all this, but again, this seems like really
hard work for such a simple job!
3. Use "advapi32.dll". This is my preferred option (assuming I'm right about
point 1). However, I'm getting errors when running the code:
[DllImport("advapi32.dll", EntryPoint="RegSaveKey")]
public static extern int RegSaveKey(IntPtr hKey, string lpFile, int
lpSecurityAttributes);
IntPtr hKey;
IntPtr hHkcu = new IntPtr((int)RegistryHive.CurrentUser);
int ret = Win32.RegOpenKey(hHkcu, registrykey, out hKey);
if(ret == Win32.SUCCESS)
{
Console.WriteLine("Return code: " + RegSaveKey(hHkcu, @"C:\regbackup.reg",
0).ToString());
}
This compiles fine, and it appears to be trying to do what it's supposed to
do. E.g. if I ensure that the file already exists, I get return code (from
RegOpenKey) 183, which is what the documentation to RegSaveKey says I should
get (file already exists, roughly). So, if I then make sure that the file
doesn't exist, instead of getting return code 0, I get 1314, which seems to
be a permission problem? However, I am an administrator.
If I do the same from the command prompt using regedit, it exports fine.
Any idea?
Cheers
Mark Tag: how to solve prblem Tag: 89429
String conversion from an Object in VB.NET
Which statement gives better performance (where obj can contain any of the
CLR runtime types)
1) CStr(obj)
or
2) obj.ToString() Tag: how to solve prblem Tag: 89426
SSL
Hello,
I use SSL in my mail application that is POP3/SSL. I download POP3 protocol
library using standard socket. The library use Socket as an communication
channel. For SSL, I use Mentalis implementation. However, Mentalis's
SecureSocket is not inherited from Socket. So, I cannot use with POP3
library. How can I solve this problem? Must I modify POP3 library to use
with Mentalis's?
Thanks,
Theewara Tag: how to solve prblem Tag: 89421
KISS Tutorials
Keep It Simple Silly....
What ever happened to it?
I am absolutly struggling to understand how to read XML files.
I am not talking about mass sized, hugely complete XML files either.
Im talking 1 level elements with attributes...
So now back to my question, what ever happen Simple easy to understand
tutorials for people like myself who dont have an IQ above 1 billion and cant
calulate the time it would take to for me to walk from here to the moon in
micromilly seconds in there head while solving the lost 5 cents of the US
government tax at the same time. Tag: how to solve prblem Tag: 89414
Unable to reuse remoting port
I am registering an object for remote access in the constructor of a Windows
Service using the following code:
BinaryServerFormatterSinkProvider provider = new
BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
IDictionary props = new Hashtable();
props["port"] =
Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings["Listen On Port"]);
TcpChannel chan = new TcpChannel(props, null, provider);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(MyObject),
"MyObject", WellKnownObjectMode.SingleCall);
This seems to work just fine until I attempt to restart the service. If
client applications have accessed the remote object and I attempt to restart
the service, the service stops successfully, but I receive the following
error when it's trying to start up again:
"Only one usage of each socket address (protocol/network address/port) is
normally permitted."
I have to wait a good 5 minutes or so before it will let me use that port
again.
Is there some way in dotnet to force the port to be released so I can
immediatly reuse it? Tag: how to solve prblem Tag: 89412
Providing IServiceProvider.QueryService to third party AX controls...
I need to use a third party database Activex control that uses the
IServiceProvider (aka IOleServiceProvider) interface to get an instance of
the application API object.
It uses this API object to get an OleDb connection string so that it can
interact with a database.
What is the best way to hook into the IServiceProvider.QueryService OLE
mechanism in .net?
As far as I understand, when the third party control receives an
IOleClientSite instance via the IOleObject.SetClientSite method, it casts it
to IServiceProvider and if not null, asks for the API object via the
QueryService method.
I have successfully cast the control to an IOleObject and passed my own
instance of IOleClientSite (which also implements IServiceProvider), but
none of the methods are being called.
((IOleObject) thirdPartyControl1.GetOcx()).SetClientSite(new
MyTestClientSite());
For all I know, a different IOleClientSite is being given shortly after
mine, or perhaps it's just a problem with the sequence of events. I really
have no idea why it's not working.
I also tried to use reflection to manually call
Control.ActiveXInstance.SetClientSite(), but it kept complaining that my
custom IOleClientSite implementation couldn't be cast correctly. This
probably makes sense since it is expecting a
UnsafeNativeMethods.IOleClientSite but actaully getting a
WindowsApplication1.IOleClientSite (even though mine has ComImport and the
same Guid).
Nathan Tag: how to solve prblem Tag: 89411
how to solve this problem:
http://support.microsoft.com/default.aspx?scid=kb;en-us;329247
As it says in the KB: "To work around this behavior, use the Timer component
that the System.Timers namespace provides." Do not use the
Windows.Forms.Timer class.