|
I'm not familiar with EVC++, but I supposed you are writing "a native code".
You can use CreateWindow. Look in the WM SDK help for class name of the SIP control
|
|
|
|
|
Hello Friends
My aim is to make a mobile application using C# dot net which will be used to send messages using twitter
I am having function's by calling which i can achieve requirements, problem is that those functions utilize System.Web Namespace which is not available with the C# windows mobile application so i added a reference to my project System.web.dll but now another problem is coming that is i need to execute a function which uses the below code
WebClient client = new WebClient()
This class can be used with desktop application
Please tell me how to start with this in a better way
If any links are known which can make a advantage with my work
please send me
thanks and regards
( '' Sorry is something Unnecessary is written NEW TO MOBILE APP DEVELOPMENT '')
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
I am developing Application using Wince.Net.
I want to remap the Keys.means we use the rotary switch for navigational purpose so i want to do that when i rotate the switch it act like left arrow key when press it it act like enter key pls help me
#include "stdafx.h"
#include "resource.h"
#include "Types.h" //Include All Global Variable And Function.
#include "tchar.h"
#define TIMER_DISPLAY 1
#include "CMonApp.h"
// Global Variables for Application
CMonApp oCMonApp;
void tempwave(HWND);
// Global Variables:
HINSTANCE ghInst; // current instance
HWND ghWnd; // Main Application Window, parent to all other windows.
wchar_t szTitle[STRTAB_STRINGSIZE]; // The title bar text
wchar_t szAppName[STRTAB_STRINGSIZE]; // The title bar text
// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK MenuDlgProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
SignalStarted(_wtol(lpCmdLine));
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance, IDS_Wnd_Class_Name, (LPTSTR)szAppName, STRTAB_STRINGSIZE);
// Load the Application Name String from String Table.
LoadString(hInstance, IDS_TITLE, (LPTSTR)szTitle, STRTAB_STRINGSIZE);
// Load the Application Title String from String Table.
MyRegisterClass(hInstance); //Call function MyRegisterClass to Create Class of Main Application
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDS_TITLE);
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage is only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASS wc;
wc.style = 0;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = 0;
wc.hCursor = 0;
wc.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
wc.lpszMenuName = 0;
wc.lpszClassName = (LPTSTR)szAppName;
return RegisterClass(&wc);
}
//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
ghInst = hInstance; // Store instance handle in our global variable
ghWnd = CreateWindow((LPTSTR)szAppName,(LPTSTR)szTitle, WS_VISIBLE|WS_POPUP,
0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
if (!ghWnd)
{
return FALSE;
}
nCmdShow = SW_SHOWMAXIMIZED;
ShowWindow(ghWnd, nCmdShow);
ShowCursor(FALSE);
UpdateWindow(ghWnd);
return TRUE;
}
//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
HWND hTray;
HFONT hFont;
static sicount;
//CDisplayResources oCDisplay;
switch (message)
{ // This message is sent when an application requests that a window be created by calling the CreateWindow
case WM_CREATE:
//Application Start-up Process
// Create various modules of the application.
// These objects have been created at run-time (instead of static allocation) to have run-time control on them.
oCMonApp.mpoDataCaputre = new CDataCapture;
oCMonApp.mpoDataStore = new CDataStore;
oCMonApp.mpoDataDisplay = new CDataDisplay( ghWnd);
// Setup various modules
// Register various modules with each other, where ever required
oCMonApp.mpoDataCaputre->RegisterFriends(oCMonApp.mpoDataStore);
oCMonApp.mpoDataDisplay->RegisterFriends(oCMonApp.mpoDataStore);
// All the modules are created and setup now.
// Start the process of data capture, display etc.
oCMonApp.mpoDataCaputre->StartDataCapture();
// Sample code for Trace calls.
CMonTrace1("Sample Trace1\n", 0, 0, 0, 0, 0);
CMonTrace2("Sample Trace2\n", 0, 0, 0, 0, 0);
CMonTrace3("Sample Trace3\n", 0, 0, 0, 0, 0);
//hTray=FindWindow(L"Shell_TrayWnd",NULL);
//ShowWindow(hTray,FALSE);
SetTimer(hWnd,TIMER_DISPLAY,10000,NULL);
break;
case WM_PAINT:
//MessageBox(NULL,TEXT("WE are in Paint"),TEXT("CMON.CPP"),MB_OK);
CMonTrace1("WndProc: WM_PAINT Msg\n", 0, 0, 0, 0, 0);
PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint(hWnd, &ps);
EndPaint(hWnd, &ps);
oCMonApp.mpoDataDisplay->DrawFreshDisplay();
break;
case WM_CMON_TICK: // Application defined message for Primary Time Tick
CMonTrace1("WndProc: WM_CMON_TICK Msg.\n", 0, 0, 0, 0, 0);
oCMonApp.mpoDataDisplay->UpdateDisplay();
break;
case WM_DESTROY:
// Delete all objects created during Start-up Process.
delete oCMonApp.mpoDataCaputre;
delete oCMonApp.mpoDataDisplay;
delete oCMonApp.mpoDataStore;
PostQuitMessage(0);
break;
case WM_KEYDOWN: // This message is posted to the window with the keyboard focus when a nonsystem key is pressed.
switch(wParam)
{
case VK_HOME:
DialogBox(ghInst,MAKEINTRESOURCE(IDD_MENU),hWnd,MenuDlgProc);
break;
case VK_END:
// Delete all objects created during Start-up Process.
delete oCMonApp.mpoDataCaputre;
delete oCMonApp.mpoDataDisplay;
delete oCMonApp.mpoDataStore;
PostQuitMessage(0); // This indicates to the system that a thread has made a request to terminate (quit).
break;
default:
break;
}
break;
//case WM_TIMER:
// //tempwave(hWnd);
// HDC hDc;
// HPEN hPen;
// RECT Rect;
// hDc=GetDC(hWnd);
// HBRUSH hBrush;
// hPen = CreatePen( PS_SOLID, 1,RGB(0,0,255));
// SelectObject( hDc, hPen);
// hBrush = CreateSolidBrush( RGB(0,0,0));
// SelectObject( hDc, hBrush);
// GetClientRect(hWnd,&Rect);
//
/*switch(wParam)
{
case TIMER_DISPLAY:
HDC hDc;
HPEN hPen;
RECT Rect;
hDc=GetDC(hWnd);
HBRUSH hBrush;
hPen = CreatePen( PS_SOLID, 1,RGB(0,0,255));
SelectObject( hDc, hPen);
hBrush = CreateSolidBrush( RGB(0,0,0));
SelectObject( hDc, hBrush);
GetClientRect(hWnd,&Rect);
for(int x=10;x<rect.right-150;x+> {
MoveToEx(hDc,x,20,NULL);
LineTo(hDc,x,Rect.bottom);
}
for(int y=20;y<rect.bottom;y+> {
MoveToEx(hDc,0,y,NULL);
LineTo(hDc,Rect.right-158,y);
}
}*/
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
/**********************************************************************************************
* Name : GetCMonInstance.
*
* Synopsis : Get the Global Instance.
*
* Return Value:
* ghInst-(HINSTANCE)Return Instance.
*************************************************************************************************/
HINSTANCE GetCMonInstance()
{
return( ghInst);
}
/**********************************************************************************************
* Name : GetCMonWindow.
*
* Synopsis : Get HANDEL of Window.
*
* Return Value:
* ghWnd-(HWND)Return Handle Of window.
*************************************************************************************************/
HWND GetCMonWindow()
{
return( ghWnd);
}
BOOL CALLBACK MenuDlgProc(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam)
{
HMENU hMenuMain,hMenu;
//MapWindowPoints(hWnd,HWND_DESKTOP,&pt,1);
hMenuMain=LoadMenu(ghInst,MAKEINTRESOURCE(IDR_MENU2));
hMenu=GetSubMenu(hMenuMain,0);
int uError=0;
HANDLE hButton;
hButton=GetDlgItem(hWnd,IDC_BUTTON1);
TPMPARAMS tpm;
tpm.cbSize=sizeof(tpm);
GetClientRect(hWnd,&tpm.rcExclude);
switch(wMsg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_BUTTON1:
SendMessage((HWND)hButton,BM_SETSTATE,1,0);
uError=TrackPopupMenuEx(hMenu,TPM_LEFTALIGN|TPM_RETURNCMD|TPM_TOPALIGN,10,320,hWnd,&tpm);
if(uError==0)
{
MessageBox(NULL,TEXT("ERROR"),TEXT("BUT1"),MB_OK);
}
return TRUE;
}
break;
/* case WM_ENTERMENULOOP:
MessageBox(NULL,TEXT("Enter"),TEXT(""),MB_OK);
break;*/
}
return FALSE;
}
void tempwave(HWND hWnd)
{
HDC hDc;
HPEN hPen;
RECT Rect;
hDc=GetDC(hWnd);
HBRUSH hBrush;
hPen = CreatePen( PS_SOLID, 5,RGB(0,0,255));
SelectObject( hDc, hPen);
hBrush = CreateSolidBrush( RGB(0,0,0));
SelectObject( hDc, hBrush);
GetClientRect(hWnd,&Rect);
//// /////////////////////////////////
/*hPen = CreatePen( PS_SOLID, 5,RGB(0,0,255));
SelectObject( hDc, hPen);
hBrush=CreateSolidBrush(RGB(0,0,0));
hBrush=(HBRUSH) GetStockObject(WHITE_BRUSH);
hDc = GetDC(hWnd);
GetClientRect(hWnd,&Rect);
MoveToEx(hDc,Rect.right/2,0,NULL);
LineTo(hDc,Rect.top,Rect.bottom);*/
/////////////////////////////////
for(int x=10;x<rect.right-150;x+> {
MoveToEx(hDc,x,20,NULL);
LineTo(hDc,x,Rect.bottom);
}
for(int y=20;y<rect.bottom;y+> {
MoveToEx(hDc,0,y,NULL);
LineTo(hDc,Rect.right-158,y);
}
if (hBrush)
{
DeleteObject( hBrush );
}
// Delete your pen.
if (hPen)
{
SelectObject( hDc, hPen );
DeleteObject( hPen );
}
}
|
|
|
|
|
I'm not sure if I got your question, but here is some pseudo-code:
int RemapKey(int OldKey){
switch (OldKey){
case VK_LEFT: if (RotarySwitch = ...) return VK_RETURN
...
}
}
...
case WM_WMKEYDOWN:
int NewKey = (int)wParam;
if ( condition for remaping )RemapKey(NewKey);
switch (NewKey){
.... standart key handling
}
You need to keep RotarySwitch with a value, according to rotation.
You need to remap only keys that will change with rotation.
Of course the easiest way is to use a table for remaping, instead of long cases, but I wrote this just to illustrate the idea and the main logic.
|
|
|
|
|
thankes its really good solution i already tried this but how can i handle KEYDOWN event on dialog box.
|
|
|
|
|
unless you don't need some special key input (arrows, tab) it is simple:
BOOL CALLBACK MenuDlgProc(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam)
...
switch(message) {
...
case WM_KEYDOWN:...
}
If you need the special keys ... well I don't know simple answer. The problem is that you will not receive WM_KEYDOWN message. The only answer that I know is to sub-class all controls inside ... but if you have more 2-3 controls ... it is ... not good.
If somebody knows easy way to make MenuDlgProc to receive this special keys ... please share it.
|
|
|
|
|
hello code project.
i have created an application
-receives sms
-process data
-update on public ip sql server connection
-reply confirmation that work is done with status
now if i start internet explorer GPRS/EDGE connection starts automatically and before the data connection ends (opened for browser) my application update in sql server perfectly, but if i send sms for data update on sql server , when data connection was somewhere ended up automatically. it doesnt start a data connection to connect over internet ip sql server, so connection fails and i get my error sms that could not open sql connection, since there was no data connection to web.
it should start GPRS, but do not anyway.
my question is. what is important to be connected over GPRS, when my application needs it.
i am stuck.
please help.
struggle boosts the wisdom
|
|
|
|
|
Is there a preferred size to try and keep 3rd party DLLs under? I'm trying to port the VCF over to Win CE, and I'm guessing the final size of all three core libraries will be ~3 Mb. Is this too much for WinCE? Are there things to do with build settings that help keep the DLL size down? I'm building with code generation set to Multi-Threaded DLL and the MinSize optimizations on.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
You need to understand the CE memory model[^]. This applies up to and including Windows CE 5.0, including all released versions of Windows Mobile. Windows CE 6.0 introduces a new virtual address space model, but Windows Mobile 6 is still based on CE 5.0.
I would strongly recommend making it available as static libraries, not DLLs. You're free to have as big an EXE as you like. Well, within the limit of whatever your device OEM left for you. That article doesn't illustrate it, but Windows Mobile has completely blown the new 32MB Slot 1 area for Execute-In-Place libraries. Devices generally ship with less than 16MB address space available. The Windows Mobile 5.0 Phone Edition VGA emulator shipped with Visual Studio 2005 has 18MB virtual address space free after a full reset; Windows Mobile 6's emulator raises this to about 25MB so they've clearly done some work on this.
Note that this only applies to native libraries; it doesn't apply to .NET DLLs as they are not loaded through the OS loader. They take up private process heap instead.
Working on large .NET applications, with a very large number of forms, it's very common to run into MissingMethodExceptions with an error message of "Can't find PInvoke DLL", which occurs simply because the address that the DLL would need to load into has already been taken by some other allocation.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
As a practical example, I'm just trying to package up our latest project. The handheld on which it runs, a ruggedised device with integrated barcode scanner, WiFi, GPRS and Bluetooth radios, has only 11.75MB of virtual address space free - and due to the number of device driver threads running, less than 1MB free in device.exe, so it's always right on the margin of failing.
On a previous device, we had to resort to stopping some drivers loading and removing some of the Today screen plugins to get a usable environment.
We're asking the OEM to replace the copy of .NET Compact Framework that's execute-in-place in the ROM with .NET CF 2.0 SP2. The customer is large enough, and ordering enough units, that they're considering it.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Gag. So I'm getting the impression that developing for CE is a royal PITA, particularly if the .Net framework in installed. Am I being unfair here?
And from what you're saying, 3rd party libs, like what I'm writing, will be very difficult to use due to memory restrictions and the presence of all sorts of Microsoft crud.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
VCF Blog
|
|
|
|
|
Good Day,
I just made a Mobile Web Application using VS2005. Whenever I compile, it launches the website using my web browser.
How can I test my Mobile Web Application using the built-in Pocket PC 2003 emulator?
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
When you create the application.. make sure you created a windows smart device NOT a windows application..
|
|
|
|
|
I am using VS2008(VB.NET) and SQL Server2005 to make a Pocket PC application.The program is running successfully into PDA to connect Sql Server2005.But when I try connect PDA with Sql Express.Then it shows sql server access denied.For express I used SERVER=.\SQLEXPRESS.But its not working.Pls help me.
|
|
|
|
|
|
Whats your connection string with sql2005??
in your connection to sqlexpress you are using the piriot ".\sqlexpress", doesnt that mean local? or is sqlexpress installed in pda?
Alexei Rodriguez
|
|
|
|
|
I have written theConnection String for Sql Server 2005:-"Server=MyServer;Initial Catalog=MyDatabase;Uid=sa;PWD=".Surface Area Configuration Manager->Remote Connections->Using both TCP/IP and named pipes.
|
|
|
|
|
Hi all,
I am creating an application which will send/receive messages, whenever a message comes in it should play a sound file(wave/mid or any other format).
How can we do it?
I am using C#.NET, Windows Mobile Smartphone SDK, Compact framework 2.0
Thanks in advance
|
|
|
|
|
From my experience, audio support with compact framework 2
is far more tedious than in ce3, you have to make do with very little,
so it may be a good idea to use 3, but of course
there are situations when you have to use ce2.
Using compact framework 3 you have access to far more including the
[SoundPlayer] class which has support for many many audio files
and does the work for you.
>> whenever a message comes in it should play a sound file
The most common way of playing a sound for ce2 would be to use
[PlaySound]... this is probably your best solution.
Once you add the class at this link you can create your own objects, either by passing
a file path or a nice way is to refer to your Resources and get the files byte array...
Sound sound = new Sound(YourApplication.Properties.Resources.SoundFile);
sound.Play();
Now the class at that link doesnt seem to work when using the stream constructor, so
add the following constructor to the class... You need to add this for the byte
array constructor example above to work...
public Sound(byte[] sound_bytes)
{
m_soundBytes = sound_bytes;
}
Now, unfortunately from what I have tested this only supports .WAV files.
You can either do this... or try using WaveOut to play your sounds, which will still
only support .WAV files but can be built upon to support more...
Or you can play any file the phone supports by calling the local systems Media Player
with a file as the argument file to execute...
db
There are 10 kinds of people, those that understand binary, and those that don't...
|
|
|
|
|
Hi
I have done some coding in c# for smartphones previously, but now I need to write a small app in C++ which is definitely not my preferred language coming from a Java world
I would like to log errors with a timestamp, but I have no idea how to get the current time in c++ for smartphones.. I tried to include time.h and use _strtime and _strdate, but the linker complains when compiling this.
Could someone please help me out? a small code sample would be nice
- Lou
|
|
|
|
|
hi Lou,
I hope this shd work
SYSTEMTIME currentTime={NULL};
GetlocalTime( & currentTime );
Sorry i had to put space between & and currenttime ,b\c its not showing properly.u remove that while compiling.
|
|
|
|
|
I need to develop a web page that can be accessed locally through deivce by developing a wireless Intrant between application server and PDA.
I want to transfer the Order data from device to Application server.
Device Specifications are:
Data GPRS Class 10 (4+1/3+2 slots), 32 - 48 kbps
HSCSD No
EDGE Class 10, 236.8 kbps
3G No
WLAN Wi-Fi 802.11b
Bluetooth Yes, v1.1
Infrared port Yes
USB Yes v1.1, miniUSB
Features OS Microsoft Windows Mobile 5.0 Smartphone
Messaging SMS, MMS, Email, Instant Messaging
Browser WAP 2.0/xHTML, HTML (PocketIE)
Complete Specifications:
http://www.gsmarena.com/i_mate_sp5-1267.php#[^]
C#.
.NET Compact framework.
ASP.NET
etc.
Any idea or suggestion.
modified on Thursday, July 24, 2008 4:04 AM
|
|
|
|
|
Good Day,
I'm developing a mobile application and it is already working perfectly in the Pocket PC 2003 Emulator in VS2005.
What I want now is to create an "installer" to deploy my application. How do I proceed?
Thanks,
Ian
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
You can use smart device cab project under setup and deployment project type.
Hope this will help you.
regards
Parasmani Swamy
|
|
|
|
|
Hi,
I developped a small app using VisualStudio 2005, CF 2.0 C# that targets the Windows Mobile 6.0 Professional operating system.
It tries to send sms in 2 different ways:
Direct:
string NumTelefono = textBox1.Text;
string Messaggio = textBox2.Text;
if (Messaggio.Length > 255)
Messaggio = Messaggio.Substring(0, 255);
SmsMessage sendMsg = new SmsMessage();
Recipient recpt = new Recipient(NumTelefono);
sendMsg.Body = Messaggio;
sendMsg.To.Add(recpt);
sendMsg.RequestDeliveryReport = true;
sendMsg.Send();
Using Pocket Outlook:
string NumTelefono = textBox1.Text;
string Messaggio = textBox2.Text;
if (Messaggio.Length > 255)
Messaggio = Messaggio.Substring(0, 255);
using (OutlookSession session = new OutlookSession())
{
SmsAccount smsAccount = session.SmsAccount;
SmsMessage smsMessage2 = new SmsMessage(NumTelefono, Messaggio);
smsAccount.Send(smsMessage2);
}
I tried both with the emulator and a real device, the sms gets sent but it's not stored in the "SMS\Sent Items".
Is there a way to implement such functionality ?
Ciao
Marco
|
|
|
|
|