|
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
|
|
|
|
|
Christopher Reiff wrote:
Owner Drawn ListBox in CE???
No freakin' way... (no OS support)
Use the list view control instead: one column and a custom draw bonanza to fill in your wildest dreams (and there are lots of articles here on CP too).
But if you really really really must use a list box, try these general principles (good luck - it's not easy ):
QA: How do I create a combo box with check marks?[^]
Regards,
João Paulo Figueira
Embedded MVP
|
|
|
|
|
Thank you João,
I'll give the list view control a shot and see what happens.
-Chris
|
|
|
|
|
i am developing a freeware app for pocket pc and am seeking an mp3
player component that from code, i can make play, pause, jump to a specific
time in the track, and read the elapsed time (pref in seconds) and
total track time. something that lets you control the play bar or view the
file graphically (waveform) as it plays and click on a portion to jump
play to that part would be nice but not necessary.
currently the only thing i've found is this cfcom product by odyssey
that lets you embed windows media player, but it's way too expensive and
has too limited license for the $ (i would pay for such a component as long as it was affordable but $400 ain't!)
does anyone know about anything that might work? someone at opencfnet.org found a way to p-invoke WMP, but you can't read the elapsed time or tell the player to jump forward to a specific time so that won't do for my purposes.
i am working in vb.net for compact framework, so either a .NET
assembly that i could include in my project, or vb.net or c# code would be
best c++ would be way over my head.
any information or advice would be most appreciated!
|
|
|
|
|
Hello !!
I have a question about making the cab file with cabWizzard (using an inf file).
I need to install a complete application on the pocket PC. This application supports multiple language. I have a resource directory in wich there is a sub-directory for each language. In each of these subdirectories, there are files containing the string in a specified language. So, the files from the different sub-directories have the SAME names.
For example:
....\MEC\NLS\FR -> contains the file PDI.str with the strings in french
....\MEC\NLS\ENG -> contains the file PDI.str with the strings in english
So now in my inf file (in order to construct the cab file), how do I specify that for the french resources, I need the PDI.str in the FR directory and for the english resources, I need the PDI.str in the ENG directory.
I wrote something like that:
[DefaultInstall]<br />
CopyFiles = BinaryFiles, FrenchResources, DutchResources<br />
<br />
[SourceDisksNames]<br />
1 = ,"Common files",,C:\MEC\Sources Pocket\Pocket Download\BIN<br />
2 = ,"French resources",,C:\MEC\Sources Pocket\Pocket Download\NLS\FR<br />
3 = ,"Dutch resources",,C:\MEC\Sources Pocket\Pocket Download\NLS\NEE<br />
<br />
<br />
[SourceDisksFiles]<br />
PDI Lite.exe = 1<br />
PDI.str = 2<br />
PDI.str = 3<br />
<br />
<br />
[DestinationDirs]<br />
BinaryFiles = 0, %InstallDir%\BIN<br />
FrenchResources = 0, %InstallDir%\NLS\FR <br />
DutchResources = 0, %InstallDir%\NLS\NEE<br />
<br />
<br />
[BinaryFiles]<br />
"PDI Lite.exe"<br />
<br />
[FrenchResources]<br />
"PDI.str"<br />
<br />
[DutchResources]<br />
"PDI.str"<br />
...And magically, that does work but I don't know why ? How can the cabwizzard differenciate the two PDI.str in SourceDisksFiles entry ???
Another little question: how can I copy dll's and register them automatically (with specifying something in the .inf file) ?
Thanks for your responses
|
|
|
|
|
Ooops... No sorry, in fact that doesn't work .
In this case, for the French and Dutch resources, the same file will be copied, that is the file in Dutch (the last one in the SourceDisksFiles entry).
How can I specify that in the %InstallDir%\NLS\FR I want the file that comes from the ....\MEC\NLS\FR directory on the desktop PC and that in the %InstallDir%\NLS\NEE directory I want the file from the ....\MEC\NLS\NEE directory ???
Thanks
|
|
|
|
|
Hi floks,
I want to download emails having attachements from email server (lets say hotmail.com) to PDA(wince3.0 and pocket 2002) into perticular directory(attachment only)
How can we download these files from sever ? Please let me know I am in urgent need.
Thanks in advance
Naresh
|
|
|
|
|
Hi All,
I am trying to store the large objects into SqlCe database. I have the datatype as image in the sql ce. The data to be stored is available as BYTES. Could anyone suggest me some solutions to achieve the same.
I tried to save by executing the commandtext. But i was not able to build a query using the byte data. I tried to use the IRowsetChange interface wherein i retrieve a rowset and update the same using the IRowsetChange->SetData(...) method. I was not able to store the data still and the program doesnt execute beyond the setdata method.
Any suggestion in this regard will be helpful.
Development environment:
EVC3.0
SqlCe.
rmkmani.
|
|
|
|
|