Hi,
How could I call an dll function using the number instead of name?
You need to get a handle to the module (DLL) that contains the function that you want to call, this is either done via LoadLibrary or GetModuleHandle function calls. You can then call GetProcAddress to get a pointer to the function.
For example assume you want to call:
int testfunc(int param) ;
You can do:
typedef int(* funcptr)(int) ;
hModule = LoadLibrary("dll name") ;
funcptr = GetProcAddress(hModule, MAKELONG(<ordinal>, 0)) ;
ret = funcptr(<param>) ;
Obviously you need to add error handling there, but thats the general idea.
thanks so much
Trying to understand RIL and how to pass all the handles and various parameters. In my code i try to initialize RIL and then use the RIL_GetEquipmentInfo function to try and get some results from it. However when i try my application out , i get something like each time i press the command button ....
406
408
40B
411
....
it seems to increment and i thought i was ment to get something like HIMALAYAS back ... Where am i wrong ???
*********************************************
bool CTerminalDlg::RIL_Initialize(DWORD dwIndex)
{
TCHAR szString[256];
CEdit* pEditShow = (CEdit*)GetDlgItem(IDC_EDIT3);
result = ::RIL_Initialize(1, OnResultCallback, OnNotifyCallback, dwNotificationClasses, g_dwParam, &g_hRil);
HRESULT test = RIL_GetEquipmentInfo(g_hRil);
::wsprintf(szString, L" %X", test);
pEditShow->SetWindowText(szString);
return g_hRil != NULL;
}
the result is returned asyncronously via the OnResultCallback function.
alright i get ya ......... so that means the answer i should get ( HTC ) will be passed to a parameter inside the OnResultCallback function ? How would i display it in a message box though ?
thanks for your help i'm struggling here.
1)http://forum.xda-developers.com/viewtopic.php?t=28835
2)there is bad idea to show message box from callback
i think this callback execute in internal RIL thread
get data that you needed from RILEQUIPMENTINFO struct and put to temp buffer
show data from temp buffer in your main thread
for example:
in main thread
1)reset Event
2)call Ril_GetEquipmentInfo
3)wait Event
4)show MessgeBox
in callback
1)store data from RILEQUIPMENTINFO to temp buffer
2)set Event
3)return
I have a problem in setting controls in a Win32 application.
When I use SendMessage to set a text string in a static control I get error number 120 which translated means: "This function is only valid in Win32 mode."
Here's the background:
I'm using Visual Studio 2005, I've installed the Windows Mobile 5 SDK.
The project was created using the New Project Wizard, with the following settings:
Visual C++/Smart Device
Win32 Smart Device Project
Platform SDK is: Windows Mobile 5.0 Pocket PC SDK
Windows application
I've added a dialog template resource and can bring up a dialog based on that resource. It contains a static control that I can read the text from, but attempting to set the text gives me the above error.
The relevent code (within the WM_INITDIALOG message handler) is:
Code:
char buffer[100];
HWND hCtrl = ::GetDlgItem(hDlg, IDC_TITLE);
LRESULT result = ::SendMessage(hCtrl, WM_GETTEXT, (WPARAM)80, (LPARAM)buffer);
This works, I get the correct text (ie the text I have placed into the static control using the dialog template editor) copied into the buffer. What follows is:
Code:
buffer[0] = 'A'; // Just to set up a different string
result = ::SendMessage(hCtrl, WM_SETTEXT, (WPARAM)0, (LPARAM)buffer);
if (result == 0)
{
LPVOID lpMsgBuf;
DWORD error = ::GetLastError();
::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, 0, (LPTSTR)&lpMsgBuf, 0, NULL);
::MessageBox(NULL, (LPCTSTR)lpMsgBuf, (LPCWSTR)"LError", MB_OK | MB_ICONINFORMATION);
::LocalFree(lpMsgBuf);
}
The attempt to set the changed text string fails (ie result == 0), and the last error is 120, which is translated to the error message above.
This works the same in both the Windows Mobile 5 emulator, and if I run it on my Atom.
What does this mean? How could it be anything other than Win32 mode?
Is there a function or something I have to call to put it into Win32 mode?
Or is it a project setting in VS2005 that I haven't been able to find?
I'd very much appreciate any help on this.
Peter
Your build target was a PPC 2003 variant for this project, correct? If so (and I'm assuming that it is so because you mention trying this on the PPC emulator), then you are most certainly not in Win32 mode, rather you are targeting WinCE. To target win32, you need to go into configuration manager and change your target at which point your program will no longer run on PPC.
More to your problem: I don't believe that you can dynamically change dialog static control properties through messaging on WinCE. I may be wrong on this here though too....
Hi there,
maybe not a XDA specific Question but maybe s.o. could still help me.
I've got a SIEMENS emem ES75 GSM Modem wich I wanted to use as a SMS receiver for my Party next month (receive sms and project them onto a wall )
But I have some trouble controlling it using the AT-Commandset.
For example: the AT+GMM Command which should give me the name of the Manufacturer) Sometimes AT+ Commands are working, sometimes not.
As it works, I printed out the current settings using AT&V:
Code:
ACTIVE PROFILE:
E0 Q0 V1 X4 &C1 &D2 &S0 \Q0 \V1
S0:000 S3:013 S4:010 S5:008 S6:000 S7:060 S8:000 S10:002 S18:000
+CR: 0
+CRC: 0
+CMGF: 1
+CSDH: 0
+CNMI: 0,0,0,0,1
+ICF: 3
+IFC: 0,0
+ILRR: 0
+IPR: 115200
+CMEE: 0
^SMGO: 0,0
+CSMS: 0,1,1,1
^SACM: 0,"000000","FFFFFF"
^SLCC: 0
^SCKS: 0,1
^SSET: 0
+CREG: 0,1
+CLIP: 0,2
+CAOC: 0
+COPS: "T-MOBILE D"
+CGSMS: 3
Remember: it says "CURRENT PROFILE"
Then I used the AT&V Command when it did not work:
Code:
Current Settings............
E0 H0 Q0 V1
&C0 &D0 &P1 &R0 &S0
S00=000 S01=000 S02=043 S03=013 S04=010 S05=008 S06=000 S07=030
S08=000 S09=000 S10=000 S11=000 S12=050 S13=000 S14=000 S15=000
S16=000 S17=000 S18=000 S19=000 S20=000 S21=000 S22=000 S23=000
S24=000 S25=005 S26=001 S27=000 S28=000 S29=000 S30=000 S31=000
S32=000 S33=001 S34=000 S35=000 S36=000
#0 :
#1 :
#2 :
#3 :
#4 :
#5 :
#6 :
#7 :
#8 :
#9 :
Why does it output the "CURRENT SETTING" instead of the "CURRENT PROFILE"? And why can't I read the SMS? With this Setting it does not accept most of the AT+(..) commands. (AT+GMM, ...)
I sniffed the serial port communication from working applications and used the same commands and init-strings, but nothing
Any advice?
Nothing?
Hi All,
I was updating my LG 540GT toswift droid 2.3 from 2.1.While using kdz_fw_upd.exe ,some error occured in between and the process was some what like stuck and not responding.So i exit the program,(meanwhile phone was showing downloading mode).So i unplugged the usb cable and removed the battery to restart it.But after that it is not even switching ON.i tried to go to recovery mode by pressing volume down+camera+power keys,button nothing happened.i tried home+volume up key,the same result.
i tried using Kdz_fw_upd.exe again,its showing "PHONE WAS NOT FOUND" error.I tried all the ways i could.Please help me if i can do anything with it?
Its bricked.
Sent from my GT540 using xda premium
So i cant do anything???
anoopmohamed said:
So i cant do anything???
Click to expand...
Click to collapse
if the phone doesnt turn on at all then u can't
do anything about it..
can the service center rectify it??my warranty expired lst month.i am ready to pay charge. they wiil not replace as the warranty expired.or the phone is unusable permenantly?
anoopmohamed said:
can the service center rectify it??my warranty expired lst month.i am ready to pay charge. they wiil not replace as the warranty expired.or the phone is unusable permenantly?
Click to expand...
Click to collapse
actually u do have little hope!
Follow this, this might unbrick ur phone if u
are lucky!
[HOW-TO] Repair your device if it feels like dead | When you click power button nothing happens (Note that this may or may not work)
Make sure you use USB ports that are in back of youre PC, dont use front ones.
Disable LGE Virtual Modem. In your Windows operating system, go to Control Panel > System > Hardware > Device Manager > Modems > Right click on LGE Virtual Modem and click Disable.
Try to boot your phone into Emergency/Download mode (VOL DOWN + POWER).
If the phone booted into Emergency/Download mode, launch KDZ Updater.
In TYPE dropdown menu, choose EMERGENCY.
Load KDZ(ROM) and flash your phone.
If the phone failed to boot into Emergency/Download mode (VOL DOWN + POWER), launch KDZ Updater.
In TYPE dropdown menu, choose CS_EMERGENCY.
Load KDZ(ROM) and flash your phone.
Thanks to fishears!
Thanks,
i had tried it all earlier :'( bt in vain...
cursing the moment where i thought of upgrading
anoopmohamed said:
Thanks,
i had tried it all earlier :'( bt in vain...
cursing the moment where i thought of upgrading
Click to expand...
Click to collapse
trust me i know how it feels...
the first week i got my phone i stuffed it up by trying
fastboot... then i managed to fix it myself. from then on
i stuffed my phone nearly every single time i tried something...
But i always managed to fix it!
But i guess bad luck 4 u..
Thanks dude..
i think my bootloader is gone if it is switching ON i had hope.bt
I heared something about Riff box jtag which can repair from brick..but i am not sure.
Can the service center fix this issue???
anoopmohamed said:
Thanks dude..
i think my bootloader is gone if it is switching ON i had hope.bt
I heared something about Riff box jtag which can repair from brick..but i am not sure.
Can the service center fix this issue???
Click to expand...
Click to collapse
yeah they can be changing the motherboard!
But i think that will cost more than the phone itself..
If u have warranty just say ur phone doesn't turn on and
they will give u a new one!
Actually the 1 warranty expired by last month(oct). When i purchased it,it came with 1.6,later i upgraded to 2.1 successfully.With this confidence only i planned to upgraded to swift droid 2.3.Do u know what had went wrong??
anoopmohamed said:
Actually the 1 warranty expired by last month(oct). When i purchased it,it came with 1.6,later i upgraded to 2.1 successfully.With this confidence only i planned to upgraded to swift droid 2.3.Do u know what had went wrong??
Click to expand...
Click to collapse
Yeah u took out the USB cable while flashing!
Sent from my GT540 using xda premium
but the program was non responsive and return with some error
[00:15:55:880] : TYPE_WPARAM_UPGRADE_ERROR
[00:15:55:880] : ¸Þ½ÃÁö º¸³¿ - TYPE_WPARAM_UPGRADE_ERROR Error Code = 1002...
so i had exit the program,then only i removed the cable unfortunate..
anoopmohamed said:
but the program was non responsive and return with some error
[00:15:55:880] : TYPE_WPARAM_UPGRADE_ERROR
[00:15:55:880] : ¸Þ½ÃÁö º¸³¿ - TYPE_WPARAM_UPGRADE_ERROR Error Code = 1002...
so i had exit the program,then only i removed the cable unfortunate..
Click to expand...
Click to collapse
I dont know about that ....
Sent from my GT540 using xda premium
the program showed up a windows-message that it does not work anymore ?
or was it just doing nothing ?
1st the program showed windows error(im using vista) asking the close down the program.So i closed and restarted the program and loaded the kdz file and it again started to do the work.but after few seconds it displayed some upgrade error like "WPARAM_UPGRADE_ERROR Error Code = 1002"
the log file is shown below
[00:15:21:945] : =============================================
[00:15:21:945] : Log is started on 26.11.2011, at 00:15:21:945,
executable: C:\Users\anoopmohamed\Desktop\swift droid\KDZ_FW_UPD.exe (ProcID: 0x00001120),
compile time : Sep 8 2010 17:19:53
[00:15:21:945] : Version :
[00:15:21:947] : strFilename1 = eur
[00:15:21:948] : m_DlMode = 4, m_strBinaryPath = C:\ProgramData\LGMOBILEAX\Phone\europen+fastboot.dz, m_nSelectedImages= 70787108
[00:15:46:357] : Start Web Downloading
[00:15:46:357] : Get Usb Port
[00:15:46:436] : rsi.strFriendlyName=Standard Serial over Bluetooth link (COM6)
[00:15:46:436] : Remove Standard Serial over Bluetooth link (COM6)
[00:15:46:436] : rsi.strFriendlyName=Standard Serial over Bluetooth link (COM8)
[00:15:46:436] : Remove Standard Serial over Bluetooth link (COM8)
[00:15:46:436] : rsi.strFriendlyName=Standard Serial over Bluetooth link (COM5)
[00:15:46:436] : Remove Standard Serial over Bluetooth link (COM5)
[00:15:46:436] : rsi.strFriendlyName=Standard Serial over Bluetooth link (COM7)
[00:15:46:436] : Remove Standard Serial over Bluetooth link (COM7)
[00:15:46:436] : rsi.strFriendlyName=Standard Modem over Bluetooth link #2
[00:15:46:436] : Remove Standard Modem over Bluetooth link #2
[00:15:46:436] : rsi.strFriendlyName=Nokia 6300 Bluetooth Modem
[00:15:46:436] : Remove Nokia 6300 Bluetooth Modem
[00:15:46:436] : rsi.strFriendlyName=Agere Systems HDA Modem
[00:15:46:436] : Remove Agere Systems HDA Modem
[00:15:46:436] : rsi.strFriendlyName=RIM Virtual Serial Port v2 (COM29)
[00:15:46:436] : Remove RIM Virtual Serial Port v2 (COM29)
[00:15:46:436] : rsi.strFriendlyName=RIM Virtual Serial Port v2 (COM30)
[00:15:46:436] : Remove RIM Virtual Serial Port v2 (COM30)
[00:15:46:436] : rsi.strFriendlyName=LGE Android Platform USB Serial Port (COM13)
[00:15:46:436] : FriendlyNameList[iii].szFriendlyName=LGE Android Platform USB Serial Port
[00:15:46:436] : WM_COPYDATA ¸Þ½ÃÁö º¸³¿ 1 - COM13
[00:15:46:436] : Port = COM13
[00:15:46:436] : Clear
[00:15:46:437] : Clear
[00:15:46:438] : UNKNOWN : Req(12) -> Rsp(13)
[00:15:46:438] : Clear
[00:15:46:439] : UNKNOWN : Req(12) -> Rsp(13)
[00:15:46:439] : Clear
[00:15:46:440] : UNKNOWN : Req(12) -> Rsp(13)
[00:15:46:440] : >> DIAG_STATUS_F FAILED
[00:15:46:445] : >>Get Model Name [DIAG_VERNO_F]
[00:15:46:445] : Clear
[00:15:46:446] : BAD CONN MODE : Req(0) -> Rsp(3)
[00:15:46:446] : Clear
[00:15:46:447] : BAD CONN MODE : Req(0) -> Rsp(3)
[00:15:46:447] : Clear
[00:15:46:448] : BAD CONN MODE : Req(0) -> Rsp(3)
[00:15:46:448] : Clear
[00:15:46:449] : BAD CONN MODE : Req(0) -> Rsp(3)
[00:15:46:449] : Clear
[00:15:46:450] : BAD CONN MODE : Req(0) -> Rsp(3)
[00:15:46:450] : Clear
[00:15:46:451] : BAD CONN MODE : Req(0) -> Rsp(3)
[00:15:46:451] : FAIL (No Phone)
[00:15:46:451] : GetModelName() Operation Failed Check Diag CMD
[00:15:46:451] : EMERGENCY Booting Mode
[00:15:46:451] : >>Get Model Name in Emergency Mode [DLOAD_VERREQ_F]
[00:15:46:451] : Clear
[00:15:46:451] : Clear
[00:15:46:452] : BS/GT540/7D
[00:15:46:452] : WM_COPYDATA ¸Þ½ÃÁö º¸³¿ 0 - GT540
[00:15:46:452] : >>Get Mobile SW [DIAG_EXT_BUILD_ID_F]
[00:15:46:452] : Clear
[00:15:46:452] : Clear
[00:15:46:453] : DLOAD_NAK_F reason_msb = 6, reason_lsb = 6
[00:15:46:453] : [ DLOAD ERROR ] : NAK_INVALID_CMD
[00:15:46:453] : Clear
[00:15:46:454] : DLOAD_NAK_F reason_msb = 6, reason_lsb = 6
[00:15:46:454] : [ DLOAD ERROR ] : NAK_INVALID_CMD
[00:15:46:454] : Clear
[00:15:46:455] : DLOAD_NAK_F reason_msb = 6, reason_lsb = 6
[00:15:46:455] : [ DLOAD ERROR ] : NAK_INVALID_CMD
[00:15:46:455] : FAIL
[00:15:46:455] : Phone_Diag_Status = FALSE
[00:15:46:455] : Clear
[00:15:46:455] : Clear
[00:15:46:456] : DLOAD_NAK_F reason_msb = 3, reason_lsb = 3
[00:15:46:456] : [ DLOAD ERROR ] : NAK_INVALID_LEN
[00:15:46:456] : Clear
[00:15:46:457] : DLOAD_NAK_F reason_msb = 3, reason_lsb = 3
[00:15:46:457] : [ DLOAD ERROR ] : NAK_INVALID_LEN
[00:15:46:457] : Clear
[00:15:46:458] : DLOAD_NAK_F reason_msb = 3, reason_lsb = 3
[00:15:46:458] : [ DLOAD ERROR ] : NAK_INVALID_LEN
[00:15:46:458] : NV Write Fail : NV ITEM 9028(9028)
[00:15:46:558] : m_pPhoneCtrl->m_pDload->Dl_GetCommMode(&m_pPhoneCtrl->m_pDload->m_nCommMode)
[00:15:46:558] : >> GET DLOAD COMM MODE
[00:15:46:558] : Clear
[00:15:46:558] : Clear
[00:15:46:559] : [GetCommMode] Communication mode : 2
[00:15:46:559] : Pre Nand Download
[00:15:46:559] : >>Set Trusted Mode [DLOAD_NAND_SEC_MODE] sec_mode = 1 (1=trusted 0=NonTrusted)
[00:15:46:559] : WM_COPYDATA ¸Þ½ÃÁö º¸³¿ 3 - TRUSTED MODE
[00:15:46:559] : Clear
[00:15:46:559] : Clear
[00:15:46:560] : [COM13] >>NandFlashInitWithFile(PARTITION TBL), BinType =8
[00:15:46:560] : NandFlashInitWithFile :: LG3GBinaryList[BinType].szBinaryTypeName = PARTITION TBL, BinType = 8
[00:15:46:560] : NandFlashInitWithFile ::
[00:15:46:560] : WM_COPYDATA ¸Þ½ÃÁö º¸³¿ 3 - INIT PARTITION TBL
[00:15:46:560] : Clear
[00:15:46:560] : Clear
[00:15:49:672] : DLOAD_NAK_F reason_msb = 55, reason_lsb = 55
[00:15:49:672] : [ JNAND ERROR ] : ERR_RESERVED_x37
[00:15:49:672] : Clear
[00:15:52:777] : DLOAD_NAK_F reason_msb = 55, reason_lsb = 55
[00:15:52:777] : [ JNAND ERROR ] : ERR_RESERVED_x37
[00:15:52:777] : Clear
[00:15:55:880] : DLOAD_NAK_F reason_msb = 55, reason_lsb = 55
[00:15:55:880] : [ JNAND ERROR ] : ERR_RESERVED_x37
[00:15:55:880] : [COM13] FAIL
[00:15:55:880] : Clear
[00:15:55:880] : WM_COPYDATA ¸Þ½ÃÁö º¸³¿ 3 - Close Port
[00:15:55:880] : Close Port<<
[00:15:55:880] : TYPE_WPARAM_UPGRADE_ERROR
[00:15:55:880] : ¸Þ½ÃÁö º¸³¿ - TYPE_WPARAM_UPGRADE_ERROR Error Code = 1002
[00:15:55:904] : Log finished
So no process was showing later.I tried a couple of times,same.So i thought of doing it later.Exit the program.But the phone was still in DOWNLOAD MODE,then i pulled out the battery and the usb cable from it.