|
hello all..currently i m working on a a program about ping a network n traceroute...im stuck with programming it...im not that sure how to write a program about "ping or traceroute"...i wonder if anione could help me with the source code..
|
|
|
|
|
If you need sourcecode for ping and/or traceroute get the linux/gnu implementations and adapt it to visual c++; but if you have a problem where you really stuck ask a specific question here.
greets
Roland
Wenn Du diesen Satz irgendwo liest, ignoriere ihn.
|
|
|
|
|
I'm trying to connect from my Managed C++ code to existing Java Code.
My problem is, that i need to link with an unknown java VM.
I tried to use the example from Sun's tutorial of the JNI, but i could not make it work.
I need explicit insturctions on how to make it work.
Can anybody help ?
|
|
|
|
|
I have a windows form tab control on it I want to place another form. I can place the form but how do I get it to move with the main form when it is repositioned.
|
|
|
|
|
I would like to wrap an mfc control class (Chris Maunder's MFC Grid control) to be used in C#. Does anyone know of a link to teach me how to do this? I kind of understand the part about wrapping classes, but what about so that it actually displays on the form at runtime and design time.
Forgive me if I sound stupid, but I've only been learning C# for a few days now (since Friday). I think I've got the basics, but I'd like to be able to do this so that I can use the control in C#. Any help is appreciated. Thanks!!
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
You know, until I saw this question, I hadn't read the source for the C Maunder Grid Control. The MFC Grid Control is an impressive body of work (and, I didn't read it all the way through on first reading).
I've never been in a project where you would have to wrap so many disparate types, but, it's probably best not to EVEN TRY to display that monster on a .NET Form.
I'm fairly new to .NET, and, in particular the Interop marshaler, but, I don't think you could wrap the "mfc control class" (because there isn't one). It's not a COM component, and consequently, has no type library. If you wanted to pursue this strategy, you'd have to wrap each individual type that C Maunder uses in his implementation, and marshaling all that data into .NET accurately would surely drive you to (well, what's the worst thing you can imagine?).
Run Time Callable Wrappers are generally for small cohesive units, like classes and interfaces and objects that are type compatible from managed to unmanaged. User defined types often require special custom marshaling routines, and much of this is trial and error.
However, I'll bet Microsoft likes the C Maunder MFC Grid Control (they have spies everywhere), and, I wouldn't be surprised if they have a highly elite team of .NET code fiends working on the advanced version as we forum.
The overriding concern here is: Just how different are MFC and .NET?
I would recommend the book: ".NET and COM: The Complete Interoperability Guide", by Adam Nathan (everything I know, I learned from this book).
To use this control in .NET, you'd have to re-write the entire thing to be compatible with the Common Language Runtime types. I think this would be a very cool commercial project. I wonder if Chris has franchised the concept yet.
|
|
|
|
|
I wouldn't try to wrap this class.
You will be better off using the Windows.Forms.DataGrid class as your base implementation (powerful class by the way) and extending it for any further functionality that you desire.
Remember, the DataGrid is different for Windows and Web namespaces respectively.
R.Bischoff
Tengas un buen dia
|
|
|
|
|
Hi all,
I will release a product in next week which can wrapping alomst all MFC CWnd as a WinForm Ctrl, if any one need, please let me know, my e-mail is sunhui@mail.apptemplate.com
|
|
|
|
|
I have a class that I use in a MFC application. The class uses a lot of CString. Now I want to use it in a MC++ class library to be able to use it in a .Net web application.
How do I do it?
// CPP_Class_Lib_01.h
#pragma once
#include "RegUser.h"
#pragma managed
#using
using namespace System;
namespace CPP_Class_Lib_01
{
public __gc class MCRegUser
{
private:
CRegUser __nogc* m_pCustomer;
public:
MCRegUser()
{
m_pCustomer = new CRegUser();
}
String* GetNameManaged(String* strName)
{
return m_pCustomer->GetName(strName);
}
};
}
//-- The file RegUser.h ----------->>
#pragma once
#pragma unmanaged
class CRegUser
{
public:
CRegUser(void);
~CRegUser(void);
CString GetName(CString strName);
};
//-- The file RegUser.cpp ----------->>
#include "StdAfx.h"
#include "reguser.h"
#pragma unmanaged
#include
CRegUser::CRegUser(void)
{
}
CRegUser::~CRegUser()
{
}
CString CRegUser::GetName(CString strName)
{
return strName;
}
|
|
|
|
|
Check out the Marshal .NET class. For example, Marshal.PtrToStringAnsi Method (IntPtr, Int32)
Which returns a Managed String from unmanaged ansi string.
Good luck!
R.Bischoff
Tengas un buen dia
|
|
|
|
|
Does any one know why i cant link my visual c++.net project if i get the following
message
error PRJ0002 : error result returned from 'rc.exe'.
is there something i should check for in the project settings?
many many many thanks to the person that will answer!!
|
|
|
|
|
Im not reall savvy with the workings of the .NET framework, I know that in the VC++ 5.0 version you can right click on the error and select the error, it'll take you to an error line, and if it drops you at the start, then their was some option somewhere that tells you what each error means.
Its not much, but I hope that helps...
|
|
|
|
|
thanks for answering, in the end i found out what the problem was, the rc.exe was complaining about missing resources in the project, in my case the icon.ico file was missing.
|
|
|
|
|
hello. i had this error too. then i had error rc2135 because it could not find my icon. but when i checked my res folder,that icon exists. i do not know what went wrong. i would really appreciate the help. thanks.
|
|
|
|
|
hello. it's okay now. my project had a japanese name. the compiler cannot read my icon. it returns a garbage so i just had to change the icon file name to an English one. thanks anyway.
|
|
|
|
|
Hi ,
I would like to know how the framework handles the following scenario.
I have an unmanaged application(UnManApp) accessing a managed
library(Manlib). This managed library, Manlib talks to the underlying storage
repository through an unmanaged library ( UnmanLib). So the situation is
having two interops.
Summarizing:
UnManApp -> ManLib -> UnManlib -> Storage Rep
So effectively the data from the unmanged world goes to the repository
through the managed- unmanaged lib .. I would like to know if the framework
does any optimisations and is this a huge performance hit.
Thanks in advance
|
|
|
|
|
In regards to the performance cost, Interop is expensive time-wise. Mostly, the extra time required to execute is related to the amount of data that you are transferring between the managed and unmanaged DLLs or executables.
Also, there are a number of additional instructions that are required for the Interop to work correctly.
From what I've read the Interop Development Team went to alot of trouble to design its system to work well with existing COM components, and native code, but, really, it depends largely on the complexity of the operation.
|
|
|
|
|
I have one list box that lists some info. How can i make it scroll down when the items are aded so that the last one is visible.
--Nikola--
modified 7-Dec-20 21:01pm.
|
|
|
|
|
There's a method on the listbox for setting the scroll position.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I tougth so but I can't find wich one.
--Nikola--
modified 7-Dec-20 21:01pm.
|
|
|
|
|
Here's how I force one to scoll:
lstFiles.EnsureVisible(lstFiles.Items.Count - 1);
That's in C#, but hopefully the method is the same in MC++. I don't see why it wouldn't be...
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
It does not work with ListBox but I found a way to do it:
listData->TopIndex = listData->Items->Count - 1;
Thanks anyway.
--Nikola--
modified 7-Dec-20 21:01pm.
|
|
|
|
|
Does any1 have an idea on how I could simulate a CPU clock in .NET?Specifically i want to simulate the ticks of a CPU clock,as part of a program that handles processes in terms of an OS...The algorithms that i want to implement have as criteria the arrival time of process in a CPU and the burst time..So i need something to count-To simulate the CPU clock..I used to do that with "time.h " in VC++ 6 but now i don't know how...
Pls Help & keep up the good work...
May it be your fate to live in interesting times
|
|
|
|
|
This may not be useful to you, it depends on what kind of accuracy you need.
In Feng Yuan's book (Windows Graphics Programming), he implements a timer with readout to produce time intervals that the operating system took to complete a GDI function calls. He used the processor's own registers and wrote most of the code in assembly. In all honesty, I didn't understand the specifics of his method, but, he was reporting time spans in microseconds. As I recall, it was a hook method, and the tricky part was returning the registers to their original value, so that the application could then time other functions.
I'm guessing you'd want something simpler and fool proof.
|
|
|
|
|
OK, essentially my friend has a game server I want to send packets to. I have no clue where to begin, but what I want to do is establish a connection with the actual game, and then have another program intervene.
It should then:
Log all packets sent from the game and spoof packets back to it.
Log all packets sent from server and spoof packets back to it.
Can this be done?
|
|
|
|