|
HI~
Is there any function in eVC++ which can pass some parameters to a running C# program?
"CreateProcess" can pass some parameters as a argument when a process start. However, how about the process is running?
Thanks~
|
|
|
|
|
I don't know about C#, but in C/C++ you can use WM_COPYDATA .
--
The Blog: Bits and Pieces
|
|
|
|
|
I'm thinking of automatically configure the 802.11 wireless network without use the standard windows wizard.
Can any expert tell me which kind of steps and APIs I should use to achieve this object.
Thanks
|
|
|
|
|
I'm doing Embedded Development using Visual C#, VS.NET 2003 & PPC 2003 SE Emulator. I have a TextBox Control and I want to change the BackColor of it when someone clicks on it. Apparently Windows Forms Designer doesn't have the Click Event on the list of events available on the Windows Forms Designer but you can generate it from within the Code Editor. The Code Editor gives you the "Click" property when you type "." after the TextBox's name and then, after you type "+=" it detects that you want to generate an event handler displays a tooltip suggesting the rest of the line as in "new EventHandler(textBoxSearch_Click); (Press TAB to insert)". When you do press TAB it generates the new "EventHandler..." line and highlights "textBoxSearch_Click" and gives you another "(Press TAB to insert)" tooltip which will generate the "textBoxSearch_Click" handler in the current Form class. I put my code in the handler but nothing happens when I click on it. I ran it through the debugger putting a breakpoint inside the handler and nothing at all!! The program behaves as if there is no click event handler on the TextBox. Note that all the other event handlers for my other controls on the form work fine. But those other event handlers where generated through the Windows Forms Designer. Any suggestions?? Ideas??
TIA
George Papadopoulos
Cosine Consultants LTD
|
|
|
|
|
HI~
In WinCE (pocket pc), how to set a window to scrollable in vertical and honzontal direction?
Thanks
|
|
|
|
|
I'd like to manage my Pocket PC from Desktop computer. For example to create file, or to delete it from Pocket PC. What should i use? Sockets? Or may be i can work with pocket pc like with a disket or any other driver by using the api functions like (CreateFile, DeleteFile)?
|
|
|
|
|
Yes, you can use RAPI (Remote Application Programming Interface wich have all the functions like CeReadFile, CeCreateFile, ...
Take a look at the MSDN for complete documentation.
Anonymous wrote:
For example to create file, or to delete it from Pocket PC
This works the other way: from within a program on your desktop computer you can delete or create files on your PocketPC. Not the other way.
Hope this helps
|
|
|
|
|
when i am writing few assembly language programs, after assembling i found .lnk and .obj files.
what the .lnk files hold and how they r built?. why there is change in opcodes of the instructions?.
Example for Mov 70h,#29h the opcode there is 757029
but for mov r1,#20h. it is giving some other opcodes.
why there is a change in this?.
ComputerNewton
|
|
|
|
|
Hi,
I am more of an embedded programmer so I this may not be correct for your situation but this is my experience from the past.
'.lnk' files are normally link files, they tell the linker how to join (link) different modules of code, in the old days programmers wrote their own link files, but it is often done by the programming environment now.
'.obj' files are object files, they are intermediate files generated from the aseembler prior to being linked together to form the final program.
Op Code
From your example 'Mov 70h,#29h', 75 will be the 'op code' for the instruction 'Mov', the source & destination are added to the end of it ie 75,70,29 = 757029
So the result for 'mov r1,#20h' will be 75,??,20 where ?? = the address (index) of r1.
Hope this helps a bit.
Ali
|
|
|
|
|
To all Gurus,
How can I get a handle to the window of item on the toay screen.
I want to refresh a today screen. But this refresh is NOT triggerred by any user input like a Tap etc but from within a DLL.
Can I send a message to the window ? but in that case I would need a handle to the window.
I know the Class Name and Window Name so how can I post a message to the window to refresh?
any kind of Help will be highly appreciated.
-SMO
|
|
|
|
|
FindWindow returns a handle to a window if you know the class name and window name
HWND FindWindow(
LPCTSTR lpClassName,
LPCTSTR lpWindowName
);
Friendly regards
|
|
|
|
|
GDvay,
Thanks a lot lof replying.
I had tried that (did not work) , There is a problem with find window.
FindWindow doesn't seem to work for The items on the today screen.
I am not sure but it could be because the items on the today screen are child windows and findWindow returns only parent windows. I am not sure whats the parent window.
Have you tried this before ? Do you know of any work around.
I am at a dead stop here.
SMOH
|
|
|
|
|
Hi~
Does the Windows XP connection firewall influence the traffic of ActiveSync?
Thanks~
|
|
|
|
|
Hi, i need to upload about 500 .jpg files to my pocket to be use by my application. Is there a way to compressed such files to lessen memory use, thanks
|
|
|
|
|
jpeg is already a compressed format, all you can do is increase the compression factor (resulting in lower picture quality of course).
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Dear Experts,
I am a novice student programmer who is touching Embedded Visual C++ for the first time in my life. (Previously only learnt BASIC and Visual Basic).
Currently, I am involved in this project to this simple pda to pda wireless communication. I am currently stuck at the server side of the communication program. (The client program has been written and tested to be working well).
The problem with the server side is that the program does not seems to execute the OnAccept function of the Listening socket(
although it jolly well could create a socket, listen for connection and seems to make the client program aware of its presence
by enable the client able to establish connection with the server whenever the client is attempting to connect the same port
that the socket is listening to). By not doing so, I am unable to create another client socket for communication. (Came to this
conclusion as neither results I have put in the function has appear when excuted)
I have declared the following Classes:
CServerApp (By default generated)
CServerDlg (By default generated)
CListenSocket (Class for the listening scoket. Base class: CSocket)
CLinkSocket (Class for the Client scoket. Base class: CSocket)
Member Variables (Only for the class CServerDlg, the rest does not have any)
IDC_cmdListen
Function: Listen for connection
Type: CButton
Member: m_bListen
IDC_cmdDisConnect
Function: Disconnect current connection
Type: CButton
Member: m_bDisconnect
IDC_cmdStop
Function: Stop all server service
Type: CButton
Member: m_bStop
IDC_Port
Function: hold the value of the port name
Type: int
Member: m_sPort
IDC_Status
Function: hold the value of the text meant for a status screen
Type: CString
Member: m_sStatus
|
|
|
|
|
#if !defined(AFX_LISTENSOCKET_H__E3F3638D_86D1_4A2D_B54C_87F2197FF509__INCLUDED_)
#define AFX_LISTENSOCKET_H__E3F3638D_86D1_4A2D_B54C_87F2197FF509__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ListenSocket.h : header file
//
#ifndef _LISTENSOCKET_H__
#define _LISTENSOCKET_H__
/////////////////////////////////////////////////////////////////////////////
// CListenSocket command target
class CServerDlg;
class CListenSocket : public CSocket
{
DECLARE_DYNAMIC(CListenSocket);
// Attributes
public:
CListenSocket(CServerDlg* pDlg);
CServerDlg* m_pDlg;
virtual ~CListenSocket();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CListenSocket)
public:
virtual void OnAccept(int nErrorCode);
//}}AFX_VIRTUAL
// Generated message map functions
//{{AFX_MSG(CListenSocket)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
// Implementation
protected:
//virtual void OnAccept(int nErrorCode);
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif
#endif
// !defined(AFX_LISTENSOCKET_H__E3F3638D_86D1_4A2D_B54C_87F2197FF509__INCLUDED_)
|
|
|
|
|
// ListenSocket.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "ListenSocket.h"
#include "ServerDlg.h"
#include "Server.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CListenSocket
CListenSocket::CListenSocket(CServerDlg* pDlg)
{
m_pDlg = pDlg;
}
// CListenSocket member functions
CListenSocket::~CListenSocket()
{
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CListenSocket, CSocket)
//{{AFX_MSG_MAP(CListenSocket)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
IMPLEMENT_DYNAMIC (CListenSocket, CSocket)
/////////////////////////////////////////////////////////////////////////////
void CListenSocket::OnAccept(int nErrorCode)
{
CSocket::OnAccept(nErrorCode);
m_pDlg->pAccept();
}
|
|
|
|
|
#if !defined(AFX_LINKSOCKET_H__12D75D46_F7FA_4860_B853_6F83CAB47C85__INCLUDED_)
#define AFX_LINKSOCKET_H__12D75D46_F7FA_4860_B853_6F83CAB47C85__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// LinkSocket.h : header file
//
#ifndef _LINKSOCKET_H__
#define _LINKSOCKET_H__
/////////////////////////////////////////////////////////////////////////////
// CLinkSocket command target
class CServerDlg;
class CLinkSocket : public CSocket
{
DECLARE_DYNAMIC(CLinkSocket);
// Attributes
public:
CLinkSocket(CServerDlg* m_pDlg);
CServerDlg* m_pDlg;
virtual ~CLinkSocket();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLinkSocket)
public:
virtual void OnReceive(int nErrorCode);
//}}AFX_VIRTUAL
// Generated message map functions
//{{AFX_MSG(CLinkSocket)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
// Implementation
protected:
//virtual void OnReceive(int nErrorCode);
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif
#endif
// !defined(AFX_LINKSOCKET_H__12D75D46_F7FA_4860_B853_6F83CAB47C85__INCLUDED_)
|
|
|
|
|
// LinkSocket.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "LinkSocket.h"
#include "ServerDlg.h"
#include "Server.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLinkSocket
CLinkSocket::CLinkSocket(CServerDlg* pDlg)
{
m_pDlg = pDlg;
}
/////////////////////////////////////////////////////////////////////////////
// CLinkSocket member functions
CLinkSocket::~CLinkSocket()
{
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CLinkSocket, CSocket)
//{{AFX_MSG_MAP(CLinkSocket)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
IMPLEMENT_DYNAMIC (CLinkSocket, CSocket)
void CLinkSocket::OnReceive(int nErrorCode)
{
CSocket::OnReceive(nErrorCode);
m_pDlg->Read(this);
}
|
|
|
|
|
// ServerDlg.h : header file
//
#if !defined(AFX_SERVERDLG_H__68FD52BF_0A0E_4EF9_8F71_52B633DED1A3__INCLUDED_)
#define AFX_SERVERDLG_H__68FD52BF_0A0E_4EF9_8F71_52B633DED1A3__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "afxwin.h"
#include "LinkSocket.h"
#include "ListenSocket.h"
/////////////////////////////////////////////////////////////////////////////
// CServerDlg dialog
class CServerDlg : public CDialog
{
// Construction
public:
CServerDlg(CWnd* pParent = NULL); // standard constructor
struct Packet
{
int packetno;
int cstatus;
char UserID[10];
char Message[20];
};
Packet RPacket;
Packet SPacket;
int State;
CListenSocket* lSocket;
CLinkSocket* eSocket;
CString screen;
void pAccept(void);
void Read(CLinkSocket* eSocket);
// Dialog Data
//{{AFX_DATA(CServerDlg)
enum { IDD = IDD_SERVER_DIALOG };
CButton m_bStop;
CButton m_bListen;
CButton m_bDisconnect;
CString m_sStatus;
int m_sPort;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CServerDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CServerDlg)
virtual BOOL OnInitDialog();
afx_msg void OnHelpInfo();
afx_msg void OncmdDisconnect();
afx_msg void OncmdListen();
afx_msg void OncmdStop();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SERVERDLG_H__68FD52BF_0A0E_4EF9_8F71_52B633DED1A3__INCLUDED_)
|
|
|
|
|
// ServerDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Server.h"
#include "ServerDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CServerDlg dialog
CServerDlg::CServerDlg(CWnd* pParent /*=NULL*/)
: CDialog(CServerDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CServerDlg)
m_sStatus = _T("");
m_sPort = 0;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CServerDlg:oDataExchange(CDataExchange* pDX)
{
CDialog:oDataExchange(pDX);
//{{AFX_DATA_MAP(CServerDlg)
DDX_Control(pDX, IDC_cmdStop, m_bStop);
DDX_Control(pDX, IDC_cmdListen, m_bListen);
DDX_Control(pDX, IDC_cmdDisconnect, m_bDisconnect);
DDX_Text(pDX, IDC_Status, m_sStatus);
DDX_Text(pDX, IDC_Port, m_sPort);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CServerDlg, CDialog)
//{{AFX_MSG_MAP(CServerDlg)
ON_WM_HELPINFO()
ON_BN_CLICKED(IDC_cmdDisconnect, OncmdDisconnect)
ON_BN_CLICKED(IDC_cmdListen, OncmdListen)
ON_BN_CLICKED(IDC_cmdStop, OncmdStop)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CServerDlg message handlers
BOOL CServerDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// 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
CenterWindow(GetDesktopWindow()); // center to the hpc screen
State = 0;
GetDlgItem(IDC_cmdDisconnect) -> ShowWindow(FALSE);
GetDlgItem(IDC_cmdStop) -> EnableWindow(FALSE);
GetDlgItem(IDC_cmdListen) -> ShowWindow(TRUE);
screen.Empty();
SPacket.packetno = 0;
return TRUE; // return TRUE unless you set the focus to a control
}
void CServerDlg::OnHelpInfo()
{
MessageBox(_T("Help"));
}
//Listen Function
void CServerDlg::OncmdListen()
{
UpdateData(TRUE);
lSocket = new CListenSocket(this);
int Port;
Port = m_sPort;
//char* txtPort;
//int i = m_sPort;
//_itoa(i, txtPort, 10);
//MessageBox(txtPort,NULL,MB_OK);
//If cannot create port
if (!lSocket->Create(Port))
{
MessageBox(_T("No port Created!"), NULL, MB_OK);
return;
}
else
{
}
//If cannot listen
if (!lSocket->Listen())
{
MessageBox(_T("Cannot listen"), NULL, MB_OK);
return;
}
else
{
MessageBox(_T("Listening"), NULL, MB_OK);
GetDlgItem(IDC_cmdListen) -> EnableWindow(FALSE);
GetDlgItem(IDC_cmdStop) -> EnableWindow(TRUE);
State = 1;
}
}
//Accept Function
void CServerDlg::pAccept(void)
{
eSocket = new CLinkSocket(this);
if (lSocket->Accept(*eSocket))
{
State = 2;
MessageBox(_T("Connection Accepted!"), NULL, MB_OK);
GetDlgItem(IDC_cmdStop) -> ShowWindow(FALSE);
GetDlgItem(IDC_cmdDisconnect) -> ShowWindow(TRUE);
}
else
{
MessageBox(_T("Connection not Accepted!"), NULL, MB_OK);
delete eSocket;
}
}
// Read Function
void CServerDlg::Read(CLinkSocket* eSocket)
{
CString strcommand;
int pRead = eSocket->Receive(&RPacket, sizeof(Packet));
if (pRead > 0)
{
if (RPacket.cstatus == 0)
{
OncmdDisconnect();
}
else
{
//command = mbstowcs(buffer, RPacket.Message, 100)
}
}
}
void CServerDlg::OncmdStop()
{
GetDlgItem(IDC_cmdListen) -> EnableWindow(TRUE);
GetDlgItem(IDC_cmdDisconnect) -> EnableWindow(FALSE);
SPacket.cstatus = 0;
lSocket->Close();
delete lSocket;
GetDlgItem(IDC_cmdListen) -> EnableWindow(TRUE);
GetDlgItem(IDC_cmdStop)-> EnableWindow(FALSE);
State = 0;
}
// Disconnect Function
void CServerDlg::OncmdDisconnect()
{
SPacket.cstatus = 0;
eSocket->Close();
lSocket->Close();
delete eSocket;
delete lSocket;
GetDlgItem(IDC_cmdDisconnect) -> ShowWindow(FALSE);
GetDlgItem(IDC_cmdStop) -> ShowWindow(TRUE);
State = 1;
}
|
|
|
|
|
I have realised what is the root of my problem: I am somehow unable to override my clistensocket::onaccept function. I have tried the solution u have posted and my own method of transfering the clistensocket::onaccept function to the main dialog classes but still I am unable to override my function. So, can any experts point why did I go wrong?
|
|
|
|
|
Hi all,
I am currently developing a PocketPC application using SqlCe2.0 and Evc++ 3.0. I am using SSCEOLEDB.
I saw the following thread in google
http://groups.google.co.in/groups?q=memory+leaks+in++ssceoledb&hl=en&lr=&ie=UTF-8&selm=078301c33c6c%24de966a80%24a301280a%40phx.gbl&rnum=1
regarding the memory leaks in SqlCe2.0 and EVC++ 3.0.
I am into the same problem now.
Memory leaks occurs every time i execute ICommandText->Execute() method.
I heard that memory leak occurs due to ICommandText->Execute() when we use Oledb for oracle. Does the same problem occurs in SqlCe2.0?
Kindly send your suggestions.
|
|
|
|
|
Greetings to all,
I am in need of some sample code or documentation (something, ANYTHING) to get me started. I've just been thrown into the CE development arena and need to write an Owner Drawn ListBox Control that will run under CE. It needs to display different fonts, fontcolor, and background colors on a line by line basis. I've not worked with CE and need a place to start. Any suggestions would be appreciated.
Christopher Reiff
|
|
|
|