|
Im new at this I just learned to how to network my computers and am now trying to play flight sims I have been flying on fighter ace and recently with IL/2Sturmovic as well as CFS3 I no they work from a server but how and can I do it?
|
|
|
|
|
Hello, I posted this question on the ASP.NET forum, but maybe this is the more appropriate forum for this question...
I would like to run a windows control in my aspx code (using the <object classid="dllname#namespace.controlname/">. I am able to display my control button in my webpage.
However, .Net security does not allow me to do much with it. All the information I found tells me I need to strongly name my assembly and then add it directly to .Net Configuration Runtime Security Policy. However, when I stronly name my assembly, in order for my control button to show up I must place the "
[assembly:AllowPartiallyTrustedCallers]" directive in my dll's code. In addition the compiler does not allow me to strongly name an assembly containing references to ones that are not, therefore I need to wrap the SHDocVw dll with a strong name as well. (I am using project->properties->wrapper assembly key file).
At this point I get in trouble, however. My control shows up and works fine on my web page. However, when it goes to create a SHDocVw.WebBrowser object I get the error "That assembly does not allow partially trusted callers". I cannot find a way to get around this. I need the web browser control to be able to access the web browser on the client machine for the project I am trying to achieve, and I cannot find another way to do it besides using the SHDocVw.dll. However, I also cannot seem to find any way to get around all the permission stumbling blocks. I am sure someone has done this before, and figured out what needs to be done. Please help!
Thank you
~Y
PS. I need to do this in .Net 1.1 I cannot resort to .Net 2.0 for this.
|
|
|
|
|
Many services in system are run through svchost.exe, as known as Dll services. As far as I consider, it is done through DllMain function.
Is it possible to create such a Dll in C# (or any managed code)? Did anyone try this?
I tried to launch a usual .exe service this way, it failed.
Thanks in advance!
|
|
|
|
|
I don't think it's possible because Managed Code doesn't support the required .DLL exports.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have written a simple user control with just a TextBox control on it and bound Its MyText Property to a DataTable Column. Using 2005 UI facilities I dragged this control from dataSources window on the form.In the form_load I fill my DataTable and by clicking a button I Call the associated BindingSource.EndEdit() whitout doing any change.But my underlying DataSet HasChanges() method returns true!? how can I Fix this problem. here is my controls source:
[DefaultBindingProperty("MyText")]
[Serializable]
[ToolboxItem(true)]
[DefaultProperty("MyText")]
public partial class TextCtl : UserControl
{
public TextCtl()
{
InitializeComponent();
}
public string MyText
{
get { return textBox1.Text; }
set
{
if(!textBox1.Text.Equals(value))
textBox1.Text = value;
}
}
}
|
|
|
|
|
Hi,
Does anyone know how to specify the default property on a class?
For instance.
I have a class called MyClassType with two properties, Name and Age. When debugging I
can move my mouse over a variable of this type, eg:
MyClassType mc = new MyClassType();
mc.Name="john";
mc.Age=100;
When I move the mouse at runtime over the last line and it will say: " mc = {MyClassType} "
However, with certain classes from the framework, eg string, enum, ArrayList etc it will show the value of one of its members. For this class it should look like:
mc {Name="john"}
Does anyone know which attribute I should use to enable this behaviour? This should save a lot of time in pressing ctrl-q and finding the correct member I tried decompiling the arraylist class but that didn't reveal any info.
|
|
|
|
|
You can speficy the default property of your class like this:
<DefaultProperty("propertyName")> _
Public Class MyClassType
' yada, yada, yada
End Class
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Very Good...
Just for Info.. the Property is in the System.ComponentModel namespace
Ricardo Casquete
|
|
|
|
|
I forgot to mention that, didn't I... :->
Thanks!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
No thanks man...
In fact it was just a point, the good one was the yours...
I have developed controls for web and windows forms... and in the moment I saw the attribute i thought in that namespace, where are all the attributes for the controls...
I thougth it was a good idea to mention it...
Ricardo Casquete
|
|
|
|
|
I now feel really silly for asking this question
|
|
|
|
|
Don't be. It's not a really obvious place to put an attribute like this. When I found it, I was looking for an attribute that I placed directly on the Property i wanted...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi,
I am about to distribute my program on a cd to the customers. It has database .The program is written in asp.net with c# and SQL SERVER 7.0. I want the customers to run the program off the CDROM without having to install anything.
What do I need to copy to the CD beside my program and the database? I want my program to be able to run on every windows 95/98 OS computer. Or do i need to chage program to windows based vb.net or cshrp.net application with ms access as database.
Thanks,
Vijayendra.
Vijayendra Shinde.
|
|
|
|
|
You don't have a choice. YOu're going to have to install the application on the client machines. If you didn't have that database, it probably wouldn't be a problem.
But, if your app can run off the CD, there's absoutely nothing preventing the user from just copying the files to the hard drive and running it from there.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I wanna know if there is a way to make low-level operations to devices (mainly the hard disk) in .Net Framework ????? (Vb.net, c++.net or c#.net)
By ways I mean maybe a class or a Windows standard API library (doesnt matter if its not managed code)
Specific things I want to know are (mostly consultations) :
- the beginning/ending number of cluster and track of files,
- the beginning/ending number of cluster and track of folders
- the size in clusters of files
- the volume serial number
- the size in clusters and tracks of a hard disk, etc
- can I do "interrupts" ???
Let me know the class or the Api library and the documentation, if there is it.
thanks, fvalerin
|
|
|
|
|
You can call any C/C++ API from .net. That said, actaully writing any sort of kernel level code (I assume interrupts would qualify here) in .net is a bad idea. There's a performance hit with every call across the managed boundary, and with low level code you're going to have to do that very frequently. Secondly if you modify any system code that's loaded by other system apps you're injecting the version of hte .net framework you use into every one of them, and if they need a different version to work, you've just broken them.
If you just want to get the values there's no harm, but modifying anything at that level is a job for C/C++.
PS you're more likely to get the API names asking in the c++ forum.
|
|
|
|
|
I would like to implement this method in a control I have that is drawing text:
Public Function CharacterIndex(ByVal Position As Point) As Integer
'find the character within the drawn text closest to this Point
End Function
I can already do the opposite, which is to find the point of a given character in the string I'm drawing on my control:
Public Function CharacterPosition(ByVal Index As Integer) As Point
If Index = -1 Then Index = Text.Length
CharacterRanges(0) = New CharacterRange(Index, 1)
StringFormat.SetMeasurableCharacterRanges(CharacterRanges)
Dim Graphics As Graphics = pnlScroll.CreateGraphics
StringRegions = Graphics.MeasureCharacterRanges(Text, Font, LayoutRectangleF, StringFormat)
MeasureRectangleF = StringRegions(0).GetBounds(Graphics)
Graphics.Dispose()
CharacterPosition = New Point(MeasureRectangleF.X, MeasureRectangleF.Y)
End Function
Thanks in advance.
-toddmo
|
|
|
|
|
Add character ranges for each character in the text, measure them, and check which one is closest.
---
b { font-weight: normal; }
|
|
|
|
|
Hello, i hv dot net 2003 installed on my pc, but it doesnt work there r some problem related to registering the components.
i hv tried all solutions on it but it is still not working , the steps which i followed for installation are as follows:
1. installed WIN Xp then SP2 then checked for IIS then VS.NET .
2. it gave erreo while creating new application in ASP.NET,so i did aspnet_regiis -i on VS command promt, it reinstalles the ASP.NET but doesnt worked.
3. then i uninstalled the .NET then sp2 , then i hv installed SP2 , configured IIS it was running, then i installed .NET againg it gave the error (("The Web server reported the following error when attempting to create or open the web project located at the following URL:"http://localhost/tpt'.'http/1.1 500 Server Error'.
4. i hv observed 1 more thing there r no COM+ objects present in the path Start>>control panel>>Administrative tools>> components services>> it gives an error when we try to view it as "error code 80080005- Server execution Failed.
PLEASE GIVE ME SOME SOLUTIONS SO THAT I CAN START WORKING ON asp.net.
thanks in advance.
(please its really urgent, hope i hv posted my question at right place )
|
|
|
|
|
Do you by any chance have a 3rd party firewall? I have to disable ZoneAlarm in order to develop (and run) my ASP .NET apps.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Ravi Bhavnani wrote: I have to disable ZoneAlarm in order to develop (and run) my ASP .NET apps.
I heard about ZoneAlarm being a problem a couple of years ago. Surely this should have been resolved in the latest versions?
Kevin
|
|
|
|
|
hi there,
I installed VS.NET 2003 enterprise architect on win2k with service pack4 and when ever I try to build a new project it gives a message box contaning "script engine error on parsing script file" and I'm tottaly stuck. so can some1 give me a solution for it.
Thanks
Shahid
|
|
|
|
|
This appears to be a mystery to everyone out there. But from what other people are saying about when they get the error, it appears that the project template files are corrupted, maybe? Try moveing the C:\Program Files\Microsoft Visual Studio 8\Common7\IDE folder to the root directory (C:\IDE ), then doing a Repair/Reinstall on Visual Studio.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello,
I am a new gay on MFC
And follow a tutorial to create my first MFC program but when a compile i have to deal with the following problem:
Compiling...
HelloMFCDlg.cpp
c:\documents and settings\propriétaire\mes documents\visual studio 2005\projects\hellomfc\hellomfc\hellomfcdlg.cpp(158) : error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char [42]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Build log was saved at "file://c:\Documents and Settings\Propriétaire\Mes documents\Visual Studio 2005\Projects\HelloMFC\HelloMFC\Debug\BuildLog.htm"
HelloMFC - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Please your help!
see the file content!
// HelloMFCDlg.cpp : implementation file
//
#include "stdafx.h"
#include "HelloMFC.h"
#include "HelloMFCDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
// CHelloMFCDlg dialog
CHelloMFCDlg::CHelloMFCDlg(CWnd* pParent /*=NULL*/)
: CDialog(CHelloMFCDlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CHelloMFCDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_MESSAGE, m_MessageST);
}
BEGIN_MESSAGE_MAP(CHelloMFCDlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDOK, &CHelloMFCDlg::OnBnClickedOk)
END_MESSAGE_MAP()
// CHelloMFCDlg message handlers
BOOL CHelloMFCDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CHelloMFCDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CHelloMFCDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<wparam>(dc.GetSafeHdc()), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this function to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CHelloMFCDlg::OnQueryDragIcon()
{
return static_cast<hcursor>(m_hIcon);
}
void CHelloMFCDlg::OnBnClickedOk()
{
// TODO: Add your control notification handler code here
//OnOK();
m_MessageST.SetWindowText("Hello from the world of MFC by Heinstein.");
}
Heinstein
|
|
|
|
|
You posted your question in the .NET Framework forum. Something that MFC has nothing to do with. Repost your question in the Visual C++/MFC[^] forum and you'll get a better response.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|