|
Thanks for the information
eladbo.
|
|
|
|
|
I'm trying to build a dll with the code in the article linked below for use in an otherwise C# (NET1.1) based project. The article itself only includes the class itself, and not any of the packaging needed to run. I tried creating a managed dll, and then just pasting the class data into the cpp/h files. I quickly ran into problems first with it not finding .net types, and then once I added those I started getting linker errors, and quickly got stuck since I haven't done anything c++ related in a long time. I assume I'm missing at least one include statement, but don't know which one.
The only change I've made to the code linked below was to pull the kernel32 stuff back into the main namespace.
http://www.codeproject.com/managedcpp/howtocomport.asp
the errors I'm getting from the linker at the moment are:
SerialPort error LNK2020: unresolved token (0A000025) _CxxThrowException
SerialPort error LNK2020: unresolved token (0A000027) delete
What I have at the moment is below:
SerialPort.h
#pragma once
using namespace System;
using namespace System::IO;
using namespace System::Runtime::InteropServices;
using namespace std;
#ifndef NULL
#define NULL 0
#endif
namespace SerialPort
{
}
SerialPort.cpp
#include "stdafx.h"
#include "SerialPort.h"
namespace SerialPort
{
}
stdafx.h
#pragma once
#include<new>
#include<iostream>
|
|
|
|
|
If I have a service running set up with Local System account.
I will get the "System variable" PATH value when calling
getenv("TEMP")
When I later run my client, I will get the current users TEMP path with the same call. Since that user as it's own defenition of TEMP
How can I get the "System variable" value for the TEMP variable when running as a "normal" user?
//T
|
|
|
|
|
%temp%<br />
%tmp%<br />
%tmpdir%
otherwise, %windir%\Temp
|
|
|
|
|
ok, i need a line of code to turn off all computers on a LAN i have the rest of the code i just need that one line
|
|
|
|
|
for_each(Lan.getComputers(), TurnOff());
one line...
|
|
|
|
|
|
Try this (but this have a two lines
<br />
for (i = 0; i < LANComputers.count; ++i)<br />
ShutDown(LANComputers);<br />
maybe take action!
-----------------------------------------------------------------
Surely without war there would be no loss
Hence no mourning, no grief, no pain, no misery
No sleepless nights missing the dead... Oh, no more
No more war
[Sleepless - Cradle of Filth]
|
|
|
|
|
Hi all!
ich searching for a tftp library which i can used e.g.
to write an application which can upload and download
cisco configuration files.
I searched with google but i got no usable result.
Thx for help.
Best Regards
madcat
|
|
|
|
|
Not a stand-alone library but I'm guessing you can extract the source which you want from here.
Ed
|
|
|
|
|
|
I recieve these Linker errors when i try to compile a Program that utilizes a Mixed DLL.
Universe error LNK2020: unresolved token (0600001A) CApplicationForm::.ctor
Universe error LNK2020: unresolved token (0600001B) CApplicationForm::GetCaption
Universe error LNK2020: unresolved token (0600001C) CApplicationForm::GetCaption
Universe error LNK2020: unresolved token (0600001D) CApplicationForm::GetHeight
Universe error LNK2020: unresolved token (0600001E) CApplicationForm::GetWidth
Universe error LNK2020: unresolved token (0600001F) CApplicationForm::Dispose
Universe error LNK2020: unresolved token (06000020) CApplicationForm::InitializeComponent
Universe error LNK2020: unresolved token (06000021) CApplicationForm::SetCaption
Universe error LNK2020: unresolved token (06000022) CApplicationForm::SetCaption
Universe error LNK2020: unresolved token (06000023) CApplicationForm::SetHeight
Universe error LNK2020: unresolved token (06000024) CApplicationForm::SetWidth
Here is the code Listing for the DLL header File Application.h which contains the Class Definitions. The Source is compiled into the DLL (CommonDLL.Dll) which is linked to the program.
Application.h
//******************************************************************************
//FILE: Application.h
//DATE: 06 Mar 03
//MODIFIED: 13 Apr 06
//******************************************************************************
//******************************************************************************
// HISTORY:
//
// COMMENT: Make sure to Include CommonDLL.lib to Input libraries
//******************************************************************************
//******************************************************************************
#ifndef _APPLICATION_H_
#define _APPLICATION_H_
#pragma once
//******************************************************************************
// INCLUDE FILES
//******************************************************************************
//References
#using <mscorlib.dll>
#using <system.dll>
#using <system.drawing.dll>
#using <system.windows.forms.dll>
#include "Windows.h"
#include "Menu.h"
#include "PlugInManager.h"
#include <vcclr.h>
#include <stdlib.h>
//******************************************************************************
//******************************************************************************
// DEFINES
//******************************************************************************
using namespace System;
using namespace System::Drawing;
using namespace System::Windows::Forms;
#ifdef DLLMAKE
#include "DLLMain.h"
#define DECLAREDLL DLLEXPORT
#else
#ifdef DLLUSE
#include "DLLMain.h"
#define DECLAREDLL DLLIMPORT
#else
#define DECLAREDLL
#endif
#endif
//******************************************************************************
//******************************************************************************
// CLASS CApplicationForm
//******************************************************************************
//
//******************************************************************************
__gc class CApplicationForm : public Form
{
private:
System::ComponentModel::Container *components;
protected:
int m_Height;
int m_Width;
String *m_Title;
public:
CApplicationForm();
// ~CApplicationForm();
//Methods
char *GetCaption(char *Buffer);
int GetHeight();
int GetWidth();
String *GetCaption();
void Dispose(Boolean disposing);
void InitializeComponent();
void SetCaption(char *title);
void SetCaption(String *title);
void SetHeight(int height);
void SetWidth(int width);
// static int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow);
};
//******************************************************************************
//******************************************************************************
// CLASS CApplication
//******************************************************************************
//
//******************************************************************************
class DECLAREDLL CApplication
{
protected:
gcroot<capplicationform *=""> m_Window;
...
CMenu m_Menu;
CPlugInManager *m_PlugInManager; // The manager for all plugins.
HINSTANCE m_hInst; // Instance of the Application
HMENU m_MainMenu; // Main Menu
HWND m_hDlg; // Any Dialog Box Display.
HWND m_hWnd; // The main app window
HWND m_hWndFocus; // The D3D focus window (usually same as m_hWnd)
MSG m_Message; // The Window's Message
public:
CApplication(void);
~CApplication(void);
bool GetMouseButton(unsigned long Button);
DWORD GetHeight();
DWORD GetWidth();
...
void SetDlghWnd(HWND hDlg);
//Methods
void SetCaption(char *str);
};
DECLAREDLL CApplication *GetApplication();
#endif
//******************************************************************************
//******************************************************************************
// END OF FILE
//******************************************************************************
Here is the Header Listing for the Program.
Universe.h
//******************************************************************************
//FILE: Universe.h
//DATE: 13 Sep 05
//MODIFIED: 20 Dec 05
//******************************************************************************
#ifndef _UNIVERSE_H_
#define _UNIVERSE_H_
#pragma once
//******************************************************************************
// HISTORY:
//
// COMMENT: Make sure to Include CommonDLL.lib to Input libraries
// Desc: Header file Universe.h
//******************************************************************************
//******************************************************************************
//******************************************************************************
// INCLUDE FILES
//******************************************************************************
#include "\Projects\CommonDll\Application.h"
#include "\Projects\CommonDll\INIFile.h"
#include "\Projects\EngineLib\Graphics.h"
#include "\Projects\EngineLib\Input.h"
#include "\Projects\CommonDll\TimingClock.h"
#using <commondll.dll>
//*****************************************************************************
//*****************************************************************************
// DEFINITIONS
//*****************************************************************************
// TODO: change "DirectX AppWizard Apps" to your name or the company name
#define DXAPP_KEY TEXT("Software\\DirectX AppWizard Apps\\Universe")
//*****************************************************************************
//*****************************************************************************
//
//*****************************************************************************
class CUniverse : public CApplication
{
protected:
CINIFile m_INIFile; //Place to Load and Save Settings;
...
CTimingClock m_Clock; //The Application Timing Clock
float m_Time; //The App Time.
float m_FramesPerSec; //The number of Frames Per Second
int m_Frames; //The Frame Number
STime m_WorldTime; //The Length of Time the World has been running.
public:
virtual HRESULT InitApp();
...
void RemovePlugInDlg();
};
#endif
//*****************************************************************************
// END OF FILE
//*****************************************************************************
Does anyone know what I am doing wrong to create these errors? Please let me know any Ideas on how to link both the Native side and the Managed Side of the DLL to the application. In the configuration for the project I'm linking with CommonDll.lib and for the managed side I have included #Using <commondll.dll>. The class is defined in the default namespace.
I appreciate any help.
Thanks in advance,
DWyvern.
-- modified at 15:32 Monday 17th April, 2006
|
|
|
|
|
Project Description
Write a client/server application implementing a shared directory at the server. The server keeps
a directory of files (a folder) where the users can upload or download files. When the user connects
to the server, he/she selects either to download a file or to upload one. If the user wants to
download a file, the server will show a list of the files found in the shared directory, and the user will
select one of them and download it. If the user selects to upload a file, the user will select the file
and send it to the server, the server will store the file in the shared directory and make it available to
the later download requests. using c#
J.U.S.T
-- modified at 5:15 Monday 17th April, 2006
|
|
|
|
|
First of all, this is the (Managed) C++/CLI forum. You should direct your question to the C# forum. Secondly, you need to ask for help with a more specific question rather than just stating your project goals. We are here to help you to program and not to be a free source of computer development.
Peace
-- modified at 8:58 Monday 17th April, 2006
|
|
|
|
|
I will bid for this project.
$1000 per month
ETA - 6 months.
-Prakash
|
|
|
|
|
I think you are being a bit conservative with your pricing!
|
|
|
|
|
I can finish this project in 5 months and 29 days
-----------------------------------------------------------------
Surely without war there would be no loss
Hence no mourning, no grief, no pain, no misery
No sleepless nights missing the dead... Oh, no more
No more war
[Sleepless - Cradle of Filth]
|
|
|
|
|
Drucik_ wrote: I can finish this project in 5 months and 29 days
Sure you can take it, I have kinda lost interest in the project
-Prakash
|
|
|
|
|
Hello World,
I am using borland C++ 5.02 for my C++ course. After successfull compiling my "hello world" program, the source code fails to run.
I mean MS DOS flashes briefly on the screen, but then it closes itself. It's doing my head in.
I would be very happy if anyone can tell me what i am doing wrong?
Thanks
Zantabri
|
|
|
|
|
The command window flashes briefly because your program runs too fast for you to see it. Open a command prompt first, change to your directory, then run your program.
1) Start -> Run -> type: cmd
2) You should now see a console window.
3) cd c:\directory1\directory\containing\your\program
4) hello.exe
|
|
|
|
|
Cheers
The program runs well from the console, But there is a catch. When i make changes to the code in the borland ide, i have to first compile and then run it in borland before i can see the changes made when i run it from the dos console.
I think it's probably got to do with my Borland IDE settings, but i have no idea where to look. I am not even sure if thats how it should b run
Can anyone give me an idea of where to look or something.
Zantabri
|
|
|
|
|
Probably you need to put some code in borland c at the end of your program somethink like
while(!kbhit()) or getch(), that waits for a user keyboard input.
-Prakash
|
|
|
|
|
Thanks
I'm doing that at the moment, it's just a little inconvenient, as i have to consider the while loop when creating programs that solve other kinds of problems.
|
|
|
|
|
Now i c what u mean by the getchar() method . It works better than a while control statement.
Thanks
Zantabri
|
|
|
|
|
Can somebody send me the steps for the cab deployment of window application in vc++.net 2003
Thank You
Pankaj
|
|
|
|