How to Find Functions within Coredll.dll ?

G

Guest

Hi,

Not done much API programming. How/Where can I get an extensive list of the
functions that exist within the Windows CE API? Mainly the ones located with
coredll.dll.

Thanks,
Zahid.
 
P

Peter Foot [MVP]

The functions are documented in the SDK for your platform (e.g. Pocket PC
2003 SDK), or within Platform Builder for every part of CE (however your
specific target device will not contain every API)

Peter
 
G

Guest

Thanks Peter.

Im developing in VB.NET for WinCE.NET 4.2 and greater devices. Sorry but im
missing something.... Where do I look for the information?

Thanks.
 
P

Paul G. Tobey [eMVP]

Each such device has an SDK which allows C/C++ programs to be built for it.
That SDK is the source for information about what is actually in the device.
Unlike on the desktop, there's nothing that you can say is absolutely
available in every Windows CE.NET device. One device might have a display
and keyboard, while another might have neither. On the display/keyboard
device, there might be windowing supported or not, while on the headless
device, CreateWindow() won't exist. You have to look at the SDK to see what
it can do and what is in coredll.dll. The set of things will be different
on every device. The device OEM will be the right person to ask for the
SDK...

Paul T.
 
G

Guest

Thanks Paul,

The OEM for the handheld im currently developing on (Sharp X200) states that
Microsoft Embedded Visual Tools 4.0 and Microsoft Embedded Visual C++ 4.0 SP2
is what should be used for application development.
I take it this is what you are referring to when you talk about the SDK for
the device?

There is also a OCX utility provided for the device that allows calling
functions such as DevCtrl.PowerKeyEnable(fPowerKeyEnable). I take it that
this utility calls into Native code?

so if eVC++ is the SDK then where do I look for the information? Native
programming is all new to me.

Thanks.
 
P

Paul G. Tobey [eMVP]

No, I'm talking about the SDK for the device. If it's a Pocket PC 2003,
there's an SDK for that that you'd download from Microsoft. If the device
is *not* a Pocket PC 2003, the device manufacturer must create an SDK for
the device and they would be the only source for it. The other things are
tools, not SDKs.

I don't know what an "OCX utility" is, but OCX's themselves *are* native
code.

Once you install the SDK, there is a folder where the header files are
installed. These files act for C/C++ as the means of connecting a file that
uses a call to the call itself. They include the declarations of the
functions in the device for which the SDK was built. You can also run eVC
and use the help to see what is available on the device, as the help for the
device is integrated into the eVC help system when the SDK is installed.

This all started at the wrong place, I think. Tell us what you want to do,
not how you are trying to do it. *Why* do you want to call native code?
*What* are you trying to do that managed code isn't good enough?

Paul T.
 
G

Guest

Paul,

Thanks for your continued help.

Firstly, correction, the OEM have provided an OCX, not an OCX utility.

Actually, Im having a problem with the SPEED of my custom picturebutton
control refresh. A picturebutton is derived from the control class. I have
35 picturebuttons in my panel.

Basically, at times Its necessary to read some data from the SQLCE database
and RESIZE and refresh some or all of the custom buttons. THe code that gets
executed simply reads the values from the database(button
backcolor,forecolor,text) using the forward only fast datareader, sets the
values for each cusom button in a while loop (computing the width,height,X,Y)
and leaves the onPaint of each control to redraw the button. Also the only
other task inside the while loop is that I set the Bounds of each custom
button. I finally call Application.doEvents().

The whole process takes average 1450ms and appears slow when using the
application.

I was slowing moving onto the idea that maybe I could learn API programming
to maybe write a native button that will be much quicker to execute.

Unless you have other ideas?

Here is my PictureButton Code:

Public Class PictureButton
Inherits Control

'Private ButtonType As String 'Button as Staydown or OneShot - some
MENU'S are staydown or oneshot
'Public buttonImg As Bitmap
Public pressed As Boolean = False
Public funcType As Integer
Public FuncValue As Integer
Public m_MultiUse As Integer
Private linesoftext As Int16 = 0
Private Shared verticalOffSet As Single
Private Shared horizontalOffSet As Single
Private str As String

Public myText As String = String.Empty

'Ensure each text line has max 8 characters
Private Shared c As Integer = 0


'Constructor with parameters - Takes RGB as colour
'Must use Sub MakeBitmap(R,G,B,width,height)
Public Sub New(ByVal MyParent As Object, _
ByVal x As Integer, _
ByVal y As Integer, _
ByVal width As Integer, _
ByVal height As Integer, _
ByVal R As Integer, _
ByVal G As Integer, _
ByVal B As Integer, _
ByVal butttext As String)


Me.Parent = MyParent
Me.Bounds = New Rectangle(x, y, width, height)

'Sets the Background Colour using RGB
Me.BackColor = Color.FromArgb(R, G, B)

'Sets the Text to be displayed onto the screen
Me.Text = butttext

'AddHandler Me.Click, AddressOf button_Click
End Sub

' Override the OnPaint method so we can draw the background image and
the text.
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)

'Adjust so that new width & Height
'are used
If Me.pressed Then
Else
'Background color already set
End If

c = 0
linesoftext = 0
verticalOffSet = 0
horizontalOffSet = 0
str = String.Empty

If myText.Length > 0 Then

ButtonsText = myText.Split("|")
'Ensure each text line has max 8 characters

For c = 0 To ButtonsText.Length - 1
If ButtonsText(c) <> String.Empty Then
'If ButtonsText(c).Length > 8 Then
' ButtonsText(c) = ButtonsText(c).Substring(0, 8)
'End If
'count no of lines in button text
linesoftext += 1
End If
Next

'Directly use the text hieght without holding
'it into a variable.
'Calculated only once
If Me.Width < 70 Then
verticalOffSet = ((Me.ClientSize.Height - (linesoftext *
12)) / 2) - 1
Else
verticalOffSet = ((Me.ClientSize.Height - (linesoftext *
21)) / 2) - 1
End If


'Calculated horizontalOffSet for each line of text
For Each str In ButtonsText

'Try
' str.TrimEnd(" ")
'Catch ex As Exception
' 'DO NOTHING
'End Try

If str.Length > 0 Then

If Me.Width < 70 Then
'Use Small Font
'Calculate with of text
gBtnTxtSize = e.Graphics.MeasureString(str,
gSmallFont)
'calculate horizontal offset
horizontalOffSet = (Me.ClientSize.Width -
Convert.ToInt32(gBtnTxtSize.Width)) / 2

e.Graphics.DrawString(str, _
gSmallFont, _
New SolidBrush(Me.ForeColor), _
horizontalOffSet, _
verticalOffSet)
verticalOffSet += 15
ElseIf Me.Width < 82 Then
'Use Medium Font
'Calculate with of text
gBtnTxtSize = e.Graphics.MeasureString(str, gMedFont)
'calculate horizontal offset
horizontalOffSet = (Me.ClientSize.Width -
Convert.ToInt32(gBtnTxtSize.Width)) / 2

e.Graphics.DrawString(str, _
gMedFont, _
New SolidBrush(Me.ForeColor), _
horizontalOffSet, _
verticalOffSet)
verticalOffSet += 18
Else
'Use Large Font
'Calculate with of text
gBtnTxtSize = e.Graphics.MeasureString(str, gFont)
'calculate horizontal offset
horizontalOffSet = (Me.ClientSize.Width -
Convert.ToInt32(gBtnTxtSize.Width)) / 2

e.Graphics.DrawString(str, _
gFont, _
New SolidBrush(Me.ForeColor), _
horizontalOffSet, _
verticalOffSet)
verticalOffSet += 18
End If


End If
Next

End If
'====================================

If Me.pressed Then

MyPen.Color = Color.Black

e.Graphics.DrawLine(MyPen, 0, 0, 0, Me.ClientSize.Height)
e.Graphics.DrawLine(MyPen, 1, 1, 1, Me.ClientSize.Height - 2)
e.Graphics.DrawLine(MyPen, 0, 0, Me.ClientSize.Width, 0)
e.Graphics.DrawLine(MyPen, 1, 1, Me.ClientSize.Width - 1, 1)

Else

MyPen.Color = Color.White
e.Graphics.DrawLine(MyPen, 0, 0, 0, Me.ClientSize.Height)
e.Graphics.DrawLine(MyPen, 1, 1, 1, Me.ClientSize.Height - 1)

e.Graphics.DrawLine(MyPen, 0, 0, Me.ClientSize.Width, 0)
e.Graphics.DrawLine(MyPen, 1, 1, Me.ClientSize.Width - 4, 1)


MyPen.Color = Color.Black

e.Graphics.DrawLine(MyPen, 0, Me.ClientSize.Height - 1,
Me.ClientSize.Width, Me.ClientSize.Height - 1)
e.Graphics.DrawLine(MyPen, 1, Me.ClientSize.Height - 2,
Me.ClientSize.Width, Me.ClientSize.Height - 2)
e.Graphics.DrawLine(MyPen, 2, Me.ClientSize.Height - 3,
Me.ClientSize.Width, Me.ClientSize.Height - 3)

e.Graphics.DrawLine(MyPen, Me.ClientSize.Width - 1, 0,
Me.ClientSize.Width - 1, Me.ClientSize.Height)
e.Graphics.DrawLine(MyPen, Me.ClientSize.Width - 2, 0,
Me.ClientSize.Width - 2, Me.ClientSize.Height)
e.Graphics.DrawLine(MyPen, Me.ClientSize.Width - 3, 2,
Me.ClientSize.Width - 3, Me.ClientSize.Height - 3)
MyPen.Color = Color.White

End If

'MyBase.OnPaint(e)


End Sub


End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top