|
I want a java ssl client to communicate nessusd server which is done in c and using SSL protocol (TLSv1) by using socket programing. If u have any idea about it pls mail me.
|
|
|
|
|
Hi guys,
I have created COM .dll in C# and regersterd it.
I want to refernce this dll from my C++ .NET application.
I know how to reference COM .dll in C#, but how to do it in C++.
Please help me.
|
|
|
|
|
|
It's simple; you do it in source code with the #using directive.
Then, the dll must be in the same directory as your application.
Alternatively, (assuming it has a Type Library) you could run the COM dll through TLBIMP.EXE, creating a .NET assembly, which is even more fun.
And, I think you have to use P/Invoke to use the unmanaged types and methods in your code. This is done with the [DllImport] atribute.
Read this:
http://msdn.microsoft.com/msdnmag/issues/03/07/NET/[^]
|
|
|
|
|
Got this problem when I run my .net wrapper class over a "c" class when this method is called. The problem code line is highlighted:
When I replace i1 or i2 with int, it works fine.
the console version calling this method works perfectly fine.
Thks.
-----
int subst_cost_qwerty(const char c1, const char c2)
{
static const int n = 33;
static const
int index[] = {
-1, /* _ 0 */
-1, /* _ 1 */
-1, /* _ 2 */
-1, /* _ 3 */
-1, /* _ 4 */
-1, /* _ 5 */
-1, /* _ 6 */
-1, /* _ 7 */
-1, /* _ 8 */
-1, /* _ 9 */
-1, /* _10 */
-1, /* _11 */
-1, /* _12 */
-1, /* _13 */
-1, /* _14 */
-1, /* _15 */
-1, /* _16 */
-1, /* _17 */
-1, /* _18 */
-1, /* _19 */
-1, /* _20 */
-1, /* _21 */
-1, /* _22 */
-1, /* _23 */
-1, /* _24 */
-1, /* _25 */
-1, /* _26 */
-1, /* _27 */
-1, /* _28 */
-1, /* _29 */
-1, /* _30 */
-1, /* _31 */
-1, /* */
-1, /* ! */
-1, /* " */
-1, /* # */
-1, /* $ */
-1, /* % */
-1, /* & */
0, /* ' */
-1, /* ( */
-1, /* ) */
-1, /* * */
-1, /* + */
1, /* , */
-1, /* - */
2, /* . */
3, /* / */
-1, /* 0 */
-1, /* 1 */
-1, /* 2 */
-1, /* 3 */
-1, /* 4 */
-1, /* 5 */
-1, /* 6 */
-1, /* 7 */
-1, /* 8 */
-1, /* 9 */
-1, /* : */
4, /* ; */
-1, /* < */
-1, /* = */
-1, /* > */
-1, /* ? */
-1, /* @ */
-1, /* A */
-1, /* B */
-1, /* C */
-1, /* D */
-1, /* E */
-1, /* F */
-1, /* G */
-1, /* H */
-1, /* I */
-1, /* J */
-1, /* K */
-1, /* L */
-1, /* M */
-1, /* N */
-1, /* O */
-1, /* P */
-1, /* Q */
-1, /* R */
-1, /* S */
-1, /* T */
-1, /* U */
-1, /* V */
-1, /* W */
-1, /* X */
-1, /* Y */
-1, /* Z */
5, /* [ */
-1, /* \ */
6, /* ] */
-1, /* ^ */
-1, /* _ */
-1, /* ` */
7, /* a */
8, /* b */
9, /* c */
10, /* d */
11, /* e */
12, /* f */
13, /* g */
14, /* h */
15, /* i */
16, /* j */
17, /* k */
18, /* l */
19, /* m */
20, /* n */
21, /* o */
22, /* p */
23, /* q */
24, /* r */
25, /* s */
26, /* t */
27, /* u */
28, /* v */
29, /* w */
30, /* x */
31, /* y */
32 /* z */
};
static const
int ctab[] = {
/* ' , . / ; [ ] a b c d e f g h i j k l m n o p q r s t u v w x y z */
/* ' */ 0, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
/* , */ 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
/* . */ 2, 1, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
/* / */ 1, 2, 1, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
/* ; */ 1, 2, 1, 1, 0, 1, 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== -1 || i2 == -1)
retval = 2;
else
retval = ctab[i1*n+i2];
//printf("[%c/%d][%c/%d]=>%d\n",c1,i1,c2,i2,retval);
return retval;
}
-----------
|
|
|
|
|
Hi
How to create Windows forms control in VC++. Net 2003?
I tried creating a windows control library using Managed Extensions for C++ using the windows control library project wizard.
But I could not host that control in IE.
But I could insert the SampleControlControl in the Windows form application and it works fine.
Why is it not hosted on IE.
Please help.
Thanks,
VK
The following is code for the HTML.
Sample Control Test
<object id="sampleControl1"
classid="http://localhost/MyControls/SampleControl.dll#SampleControl.SampleControlControl"
="" height="200" width="200">
|
|
|
|
|
|
Veena Katti wrote:
But I could not host that control in IE.
Can you provide more details?
What are your security settings in IE for localhost domain ?
Did you check your security settings for the .NET runtime on the computer trying to access the IE hosted control ? (use caspol.exe or .NET Configuration Tool )
R.Bischoff
Tengas un buen dia
|
|
|
|
|
Hi,
what are the differences in the types of projects in visual c++? what is MFC?ATL?STL?
Thanks
|
|
|
|
|
Hadi Fakhreddine wrote:
what is MFC?ATL?STL?
MFC == microsoft foundation classes
it is not only a set of classes and functionnalities, but a whole framework.
STL == Standard template library
it is the C++ standard template functions & classes.
Hadi Fakhreddine wrote:
what are the differences in the types of projects in visual c++?
the binaries won't be built the same way if you code for a DLL, an MFC exe, a console application...
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
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. 
|
|
|
|
|