dllimport


How can I get a COM component which can be used on Windows phone 8 project with C#


Recently,I started working on Windows phone developing.
I got a project which was written in C language,in my windows phone 8 Solution. I created a Dynamic link library(DLL) project and it can be built successfully. In it,I use a runtime component project to provide the DLL’s method to the UI(C#) project. In method,I have some pointer parameters,I use Intptr object to pass a byte[] object to the runtime component project. Unfortunately, this caused the program to crash.
How can I pass a pointer parameter to the runtime component project or DLL project? Perhaps,there is another way which can use [Dllimort] method to import my DLL file?
Any help is appreciated!
PS: My solution's structure:
[Dynamic link library project(C++)].dll_method(void *para);
[Runtime component project(C++)].rc_method(Intptr p)
{
dll_method((void*)p);
}
[Windows phone 8 project(C#)].method()
{
GCHandle g = GCHandle.Alloc(byte[], GCHandleType.Pinned);
IntPtr p = g.AddrOfPinnedObject();
rc_method(p);
}
Unless you're doing remote-process communication, to call a Windows Phone Runtime Component (C++) from a Windows Phone App Project (C#), all you need to do is add the native project as a reference.
You can pass any WinRT supported type over as arguments. And as for callbacks, you can also use events (if in the same process), or pass in callback types (for RPC).

Related Links

DllImport is not found C++
Mangled member function name different during dllimport
how to use DllImport in metro-style app
Converting doc file to post script
How can I get a COM component which can be used on Windows phone 8 project with C#
Externs and DLL imports
Mixed native and managed code heap corruption
MarshalDirectiveException
call unmanaged C++ code from C# using pinvoke
Detecting DLL Code Splicing
WOW64 Redirection and LoadLibrary
Using C# dll in Windows phone 7
Python 2.5 Import dll AttributeError
Replacing the Import Table in PE file by standart LoadLibrary
Unresolved external symbol
Declare and <DllImport> in VB.NET have different results

Categories

HOME
service-worker
beautifulsoup
paraview
prism
dns
toolbox
interface
battery
solver
alarm
access
seo
nested-if
hpc
settings
tvos
spring-session
mvc5
crystal-lang
trac
nstableheaderview
teechart
p2p
pattern-matching
onedrive-api
intershop
smartclient
sencha-touch
lilypond
babel
systemtime
ember-cli
pchart
object-storage
roundup
licensing
fragment-backstack
underscore.js
soot
spotipy
left-join
quickfixj
erb
mailkit
biztalk-rule-engine
pdw-file-browser
processwire
lubridate
engine.io
hivemq
reactivekit
diacritics
jvmti
visa
portforwarding
install.packages
print-css
claims
file-sharing
puredata
textsum
tinymce-3
tf
static-cast
oracleclient
css-transforms
gpg-signature
baidu
vibrate
choice
grails-plugin
mapxtreme
centrifuge
nikeplus-api
simevents
cfchart
nservicebus5
lazybones
morton-number
opserver
toolkit
jdk1.7
uncompress
airbrake
git-ftp
iso-prolog
linkedin-jsapi
ss7
live555
android-framework
square-bracket
http-patch
jammer
code-duplication
cocoalibspotify-2.0
printdialog
diem
pagedown
android-sdk-2.3
resource-management
device-width
correlated-subquery
objectquery
azman
kqueue
node-redis
htdocs
event-receiver
collectionviewsource
photolibrary
uideviceorientation
binomial-heap
qtabbar
mathematical-notation
sun
lemmatization
movieplayer
wspbuilder

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App