|
Tim Smith wrote:
Sort of apples and oranges.
HTTP is built on top of TCP.
Would I be right in saying that while HTTP is built on top of TCP/IP, HTTP can cross firewalls easilier than TCP/IP in the sense that the port for HTTP is almost always open.
Or maybe I should say: If I use TCP/IP directly as a comms protocol in an app will it be blocked "more" than HTTP, or, because HTTP is built on TCP/IP, there is no difference?
Or am I talking apples and oranges? Just thinking of some ideas and wondering what protocol to use for text messaging type comms.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
The greatest thing you'll ever learn is just to love, and to be loved in return - Moulin Rouge
Tim Smith wrote:
Over here in the third world of humor (a.k.a. BBC America),
peterchen wrote:
We should petition microsoft to a "target=_Paul" attribute.
|
|
|
|
|
I can compile my project fine, but everytime I go to run my program from within the VS.NET IDE I get the messagebox that says
These project configuration(s) are out of date:
"ProjectName - Configuration Name"
Would you like to build them?
It says this for any build config. If I hit yes it'll recompile the resources, relink then start my program. I don't understand why this always happens even after just rebuilding my project. It doesn't happen with all my projects, and I haven't been able to find an option or anything to try changing.
Anyone have any ideas?
-Lunchy
|
|
|
|
|
You'll get that messagebox if a file has been modified since the last compile. So this means one of several things, you have a post-build step that is modifying one of the files (version incrementer?), a virus which is embedding itself in a file once a file has closed, or its just a random bug.
Sorry I can't be of more help,
James
Simplicity Rules!
|
|
|
|
|
Hrmmm, SourceSafe wouldn't being doing anything would it? I wouldn't think so, but that's the only other thing I could think of. Shouldn't be a version incrementer as I'm not using one. And as far as a virus, I'd think it's a longshot. I've recreated the project and I get the same results. Unless it's attatched to a source file and not a project type file. Maybe it has something to do with wxWindows inards... who knows.
Thanks much for the reply!
-Lunchy
|
|
|
|
|
SourceSafe might be doing something; but it seems odd. If you create a project not using SourceSafe do you get the same problems? I don't have SourceSafe here so I can't vouch for its innocence.
James
Simplicity Rules!
|
|
|
|
|
Oh yea, good point. I'm pretty sure I wasn't using sourcesafe on that new project. Must be something else...
-Lunchy
|
|
|
|
|
Hi there !
I have a tricky little problem. First I have to elaborate on my custom application architecture.
I am desigining a highly extensible game engine which gets almost all functionality out of plugins which are implemented as .NET assemblies.
I have a class called "Node" which wraps dynamically loaded classes via their object base class and supports invocation of methods via reflection as well as other things..
Nodes are organized in a hierarchy . Every Node contains a SortedList storing all child nodes, as well as a Node Reference pointing to the
Parent node of a given node, as well as an object reference pointing to the wrapped class ( which was imported from the plugin assembly )
Now i want to save the hierarchy to a file via serialization. However i only want to save parts of the hierarchy from a given node. However since there is a parent reference , always the whole hierarchy gets serialized since the serializer walks both ways automatcially.
So i want to restrict the serialization of the parent reference in certain cases dynamically. I can'T just add "Noserialze" attribute to the parent reference, since all classes are wrapped in Nodes and there can't be derived classes.
Because of that i want to support ISerialize on the Node class to control what gets serialized and stop at a given node.
However i do not seem to get that working. In particular how do i have to serialize the SortedList for the child nodes ?
This is what i have so far:
public void Node.GetObjectData( SerializationInfo info,StreamingContext context )
{
info.AddValue("Id",m_identifier ); // Store the node id
foreach( Node n in m_children.Values )
{
string name = n.Name;
info.AddValue ( "Name",name );
info.AddValue ( "Node",n );
}
if ( m_parentSerialize )
info.AddValue("Parent",n.Parent );
}
However this does not seem to work
I also tried calling GetObjectData for the child nodes..
Seems not to work either.. .
Any clues ?
|
|
|
|
|
The way the default serializer works, is it will not serialize an object if it is already serialized, but it will store a value so that when deserialized it will point to the proper object. So you shouldn't have to implement ISerializable .
Anyway, in your code the problem is the foreach loop. You are adding the node names and the nodes, but they have the same name each time; so you are adding the data but when you go to deserialize it, you are getting the same data back each time.
James
Simplicity Rules!
|
|
|
|
|
Hi !
THanks for you answer. I know that the serializer stores each object only once. But thats not the idea behind my question, because in my graph there are CERTAIN objects that MUST NOT be serialized... This is because e.g high level objects are in the graph like the graphics renderer or sound engine, which can be different on other machines, but still the serialized files should be loadable. So i need the Iserializeable interface.
The code i sent in was just some dummy code, here is the REAL CODE now:
private Node ( SerializationInfo info, StreamingContext c )
{
m_children = new SortedList();
Debug.WriteLine("Deserializing object");
// And finally the node data itself.
m_reference = info.GetValue("WrappedObject",typeof(object) );
m_id = (Identifier)info.GetValue("Id",typeof(Identifier) );
Debug.WriteLine(m_id.Name,"Assigned key to");
// Add number of children
int numChildren = (int)info.GetValue( "ChildrenCount",typeof(int) );
// Serialize the child nodes first
for( int i = 0; i < numChildren; i++ )
{
// Generate an index key
string nodeName = "Node" + i;
Node newNode = (Node)info.GetValue(nodeName,typeof(Node) );
Attach( newNode );
}
// Now we store the parent reference.
if ( m_parentSerialize )
m_parent = (Node)info.GetValue("NodeParent",typeof(Node) );
}
///
/// Serialization method for nodes. This is required
/// so that the class tree does not get walked in the
/// wrong direction, since we want certain node wrapped
/// classes to be kept out of serialization.
///
/// <param name="info" />Serialization info.
/// <param name="context" />Serialization context.
public void GetObjectData( SerializationInfo info, StreamingContext context )
{
Debug.WriteLine(Id.Name,"GetObjectData called for");
// And finally the node data itself.
info.AddValue("WrappedObject",m_reference );
info.AddValue("Id",m_id,typeof(Identifier) );
// Add number of children
info.AddValue( "ChildrenCount",m_children.Count );
int index = 0;
// Serialize the child nodes first
foreach( Node n in m_children.Values )
{
// Generate an index ke
string nodeIndex = "Node" + index;
info.AddValue( nodeIndex,n,typeof(Node) );
index ++;
}
// Now we store the parent reference.
if ( m_parentSerialize )
info.AddValue("NodeParent",m_parent,typeof(Node) );
}
The problem now is that "Attach" adds the node to the SOrtedList representing the children with m_id as the key and the node as the value. HOWEVER i get the exception that the KEY is NULL all the time. I added some debug messages and it seems that a child node is added BEFORE it got an ID, so it is not complety reconstructed....
Any clues ?
|
|
|
|
|
What is the code for Attach, from what I can tell everything looks fine there; and how does m_id and newNode interact? I don't see anything that brings them together.
James
Simplicity Rules!
|
|
|
|
|
I could be off the mark here but couldn't you just let serialization happen naturally and mark the fields in the graph that you don't want serialized with [NonSerialized()]?
Regards
|
|
|
|
|
If you copy some code from a web page and try to paste it into an .aspx file in VC7 it usually inserts a bunch of bogus html tags. Is there a way to paste as plain text without the html tags?
<%@ Import Namespace="System.IO" %>
<SCRIPT LANGUAGE="C#"
RUNAT="SERVER">
should be
<%@ Import Namespace="System.IO" %>
</p>
If it's not built in, is there a way to do it via macro?
grrr
P.S. what tags do I use to prevent CP from eating characters such as > < < etc.?
|
|
|
|
|
Menu Edit - Paste as HTML ?
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
That works if it's an HTML file but not a .aspx file. Weird.
Todd Smith
|
|
|
|
|
Todd Smith wrote:
P.S. what tags do I use to prevent CP from eating characters such as > < < etc.?
CP isn't eating < and >, your web browser is. Replace < with < and replace > with >
James
Simplicity Rules!
|
|
|
|
|
|
Guys:
I am very new to .Net.
I have setup CDs of Visual Studio.Net Enterprise Architect. When I run the setup on Win 98, it says the OS should be at least Win NT4.0.
Will ME or XP OK?
|
|
|
|
|
Srini Kella wrote:
Will ME or XP OK?
XP is OK.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
The Framework (which is required for someone to run a .NET program) requires Windows 98 or later, or Windows NT 4.0 or later.
The SDK and Visual Studio .NET both require Windows NT 4.0 or later or Windows XP Professional.
James
Simplicity Rules!
|
|
|
|
|
And Windows NT4 must be SP6a.
Kevin
|
|
|
|
|
What is your %PATH% after installing .NET?
I was just reading through a .net book and they said to run ildasm.exe from start/run. Apparently I didn't have the proper path in my environment variable. Did something goof up during my install?
Todd Smith
|
|
|
|
|
As far as I know the path isn't set if you run the setup from VS.NET, but you are prompted to set the path if you install the SDK separately.
In anycase, add %WINDIR%\Microsoft.NET\[framework version]\ to your path.
James
Simplicity Rules!
|
|
|
|
|
I have the following method that instantiates a specified class in a given .NET assembley with specified activation attributes.
HRESULT LoadCORClassEx(
BSTR AssemblyName, /* mscorlib */
BSTR typeName, /* System.Text.RegularExpressions.Regex */
REFIID riid,
void **ppv,
SAFEARRAY *args)
{
HRESULT hr = S_OK;
if(ppv == NULL) return E_POINTER;
*ppv = 0;
/*** debug ***/
VARIANT var;
HRESULT hresult;
long ix = 0;
VariantInit(&var);
hresult = SafeArrayGetElement( args, &ix, &var);
if(FAILED(hresult)) return hresult;
/*** end debug ***/
CComPtr<_ObjectHandle> spHandle;
spHandle.p = g_host.spDefaultAppDomain->CreateInstance_2(
AssemblyName,
typeName,
args);
CComVariant unwrapped;
unwrapped = spHandle->Unwrap();
if (unwrapped.vt != VT_UNKNOWN && unwrapped.vt != VT_DISPATCH)
return E_UNEXPECTED;
return unwrapped.punkVal->QueryInterface(riid, ppv);
}
I can get the contents of the args SAFEARRAY that is passed into this method into a variant -- shown in the debugger as {"abc" VT_BSTR} -- before the subsequent call to CreateInstance_2(), however, when I step into the call to CreateInstance_2(), the underlying raw_CreateInstance_2() call in mscorlib.tli blows up .
Can anyone see what I am doing wrong here? I tried adding the save /*** debug ***/ code to mscorlib.tli in order to peek at the content of the SAFEARRAY being passed for activation attributes, but the debugger seems to ignore the added code...
Thanks for any insights!
--
Roy
|
|
|
|
|
Sometimes this may happen if you forgot to call SysAllocString to allocate the BSTR. Make sure that you are not doing anything like
VARIANT vt;
vt.vt = VT_BSTR;
vt.bstrVal = OLESTR("Test");
Check the same for other BSTR's
|
|
|
|
|
The code that creates the SAFEARRAY looks like the following:
HRESULT hRes;
VARIANT Placeholder;
LPCTSTR str = session->GetString((pbstring)(pbvArgs[i]->GetString( session )));
_bstr_t bstr_val( str );
Placeholder.bstrVal = SysAllocString( bstr_val );
hRes = SafeArrayPutElement( psaArgs, &Place, &Placeholder );
if (hRes != S_OK)
{
pbrRet = PBX_E_INVOKE_FAILURE;
}
VariantClear(&Placeholder);
The SAFEARRAY is then passed to another call:
LoadCORClassEx (bstr_1, bstr_2, IID_IUnknown, (void**)&pIDispatch, psaArgs);
Do you see anything else that I might be doing wrong?
Thanks,
Roy
|
|
|
|