|
It is true, but there is a way to modify such behavior.
If you mark your variable with ThreadStaticAttribute then this variable will be unique for thread.
Best regards
Sergey
|
|
|
|
|
Every program that is running on your computer has its own Process. The operating system creates the process which your program will run. Each process has its own stack and heap and depending on how many threads you are running, and the operating system every thread in your program will have its own stack. This is true no matter what DLLs are being used by your program. DLLs or shared libraries do not have their own stack or heap.
|
|
|
|
|
Does anyone know how to send an object through TCP Socket?
Or how can I convert an object to a byte array in .NET Compact Framework?
Thanks a lot!!!
|
|
|
|
|
Try .Net Remoting (look it up on msdn and there are lots of books). The object must be serilizable first so don't try to move a datatable or a hashtable.
|
|
|
|
|
But if I am using .NET Compact Framework, how can I do so? It is because there is no .NET remoting in .NET Compact Framework. Thanks a lot for your reply
|
|
|
|
|
You can use binary serialization to write the object out as a binary stream and reconstruct it at the other end.
private void Serialize(NetworkStream stream, object obj)
{
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, obj);
}
private object Deserialize(NetworkStream stream)
{
BinaryFormatter formatter = new BinaryFormatter();
return (YourTypeHere) formatter.Deserialize(stream);
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
thanks so much. But there is no binary serializable class in .NET compact framework, it only available in .NET framework.
anyway, really thanks a lot!
|
|
|
|
|
How about using System.Xml.Serialization.XmlSerializer to serialize and deserialize data? Is that available in CF?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
it is not available too. But I found from some books that seems it is related to what you suggested, the Xml Web service.
Really thanks so much!!
|
|
|
|
|
Hi i using this Sample for VB.Net
http://www.freevbcode.com/AuthorInfo.asp?AuthorID=6163
I need update for Close Connections.
API is : SetTcpEntry
Declare Function SetTcpEntry Lib "IPhlpAPI" (ByRef pTcpRow As MIB_TCPROW) As Integer
Inside Command1_Click and area With TcpTableRow, inserting this code for test :
If CStr(GetTcpPortNumber(.dwRemotePort)) = "1452" Then
MsgBox("Found")
.dwState = 12
SetTcpEntry(TcpTableRow) --> BreakPoint
End If
1452 is remote port the my Laptop connected to Game Server in my PC.
I looking using Netstat -n
This Stop in BreakPoint but not Close Connection.
ny idea or Sample Code working ?
|
|
|
|
|
Any idea how to embed an exectuable inside another executable, and then from with in your program, call the embeded exectuable with out creating another process or wrting the embed exectuable to disk?
I have a C++ program (straight C++, not managed). It has some logic and then depending on a number of conditions, ShellExecute()s another exectble file (client.exe), which happens to be a .net file. Is there anyway that I can add this client.exe file as a resource of my C++ program, and then call the beginning of the code from within the C++ program, so I wouldn't have to extract the resource or create a new process
Please help
Thanks,
Jason A. Donenfeld
PS: This is what I have now:
<br />
#define WIN32_LEAN_AND_MEAN<br />
#include<br />
#include<br />
#include<br />
<br />
#define INSTANCEMESSAGE "ShowZIM"<br />
#define WINDOW_TITLE "ZX2C4InstantMessenger"<br />
#define MUTEX_STRING "Local\\ZX2C4IM"<br />
#define FILE "client.exe"<br />
<br />
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)<br />
{<br />
if(_tcscmp(lpCmdLine,"clone"))<br />
{<br />
CreateMutex(NULL,TRUE,MUTEX_STRING);<br />
if(GetLastError()==ERROR_ALREADY_EXISTS)<br />
{<br />
SendMessage(FindWindow(NULL, WINDOW_TITLE), RegisterWindowMessage(INSTANCEMESSAGE), NULL, NULL);<br />
return 0;<br />
}<br />
}<br />
ShellExecute(NULL,NULL,FILE,lpCmdLine,NULL,SW_SHOW);<br />
return 0;<br />
}<br />
|
|
|
|
|
As far as I know, you can't do that. I don't know of any Execute method that will load a file from memory.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
I figured there might have been a round-about way to do this. I think your right though, there's no way I'd go through this kind of trouble just to embedded an .EXE.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
At one time I had 1.1 and VS.NET Eterprise architect 2003.
Due to lisencing issues I had to take 2003 off and Insatall VS.NET Eterprise architect 2002. Along with that also came Framework 1.0
Now I am stuck with 1.0 (I still have 1.1 on my box). Is there a way I can switch from 1.0 to 1.1 with out disturbing my VS.NET installation or messing up my box.
Thanks.
|
|
|
|
|
No. VS.NET 2002 will only target the .NET Framework 1.0. It won't compile against 1.1.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a EXE for my vb.net project. I want to keep this on a server and put shorcut on client machines to launch this.
Any information regarding issues,problems, requirements will be help ful.
Thanks
|
|
|
|
|
When you connect to server. on the project dir, right click Map Network Drive. Chose letter. then make a shorcut.
Did it help
|
|
|
|
|
Sorry for not being clear and thanks for your response
I am done developing this. My application is a exe. I don't want to distribute this exe to users. Rather have it on the server and just create a shortcut on user desktops to launch it.
|
|
|
|
|
If you do this without changing the settings, you will get a security exception. This is because by default you cannot run a .NET application over a network.
You can go into the Control Panel and run ".NET Framework 1.1 Configuration" and select the "Runtime Security Policy" from the tree. There are lots of options for allowing .NET applications to run in various situations. The subject area is quite large and you may get better information by googling the phrases I've quoted in conjunction with .NET
However, you may find that is is easier to create a deployment package and install it on each desktop.
I hope that helps.
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Thanks for the response. Yes I did change the settings so that it runs with out popping up the security exception. But is their really any issue/problems in doing this.
|
|
|
|
|
|
There is one issue. If all of your clients don't close the application and you want to replace the .EXE, you won't be able to do it. Everyone must close the application (and not leave it running, lock the workstation, and go home!) before you will be able to replace it, if need be.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
My boss just gave a new task, one I am not sure I know how to address...
Develop a fat .net client that has a reporting component where the customer can create custom reports against an xml "dataset" retreived from a unix server.
Outputs PDF, XLS, HTML, print support support blah blah blah...
Crystal Reports, ActiveReports, ComponentOne? Not sure where to go for this?
Both canned reports and Ad-hoc reports must be supported on the client.
Licensing should be for free public distribution of course.
Since the app will be freely distributed via the Internet, Licensing and support are the big issues, other than the fact that the data will reside on a server and only the "resultset" will be returned by the server.
Guess I will have to write some sort of query tool as well.
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|