Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 29th, 2008, 09:39 AM
Registered User
 
Join Date: Nov 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default pls help me..

i used the code that was posted in msdn help and support for sending sms in mobile using asp.net. but i found these following errors.

[DllImport("sms.dll")]
   private static extern IntPtr SmsOpen(String ptsMessageProtocol,
     IntPtr dwMessageModes, ref IntPtr psmshHandle, IntPtr
     phMessageAvailableEvent); [DllImport("sms.dll")]

private static extern IntPtr SmsSendMessage(IntPtr smshHandle, IntPtr
  psmsaSMSCAddress, IntPtr psmsaDestinationAddress, IntPtr
  pstValidityPeriod, byte[] pbData, IntPtr dwDataSize, byte[]
  pbProviderSpecificData, IntPtr dwProviderSpecificDataSize,
  SMS_DATA_ENCODING smsdeDataEncoding, IntPtr dwOptions, IntPtr
  psmsmidMessageID);

[DllImport("sms.dll")]
   private static extern IntPtr SmsClose(IntPtr smshHandle); the highlighted lines shows error..
Error 1 Expected class, delegate, enum, interface, or struct
Error 3 Identifier expected
Error 8 The modifier 'extern' is not valid for this item
Error 9 The namespace '<global namespace>' already contains a definition for '?'

i would be extremly grateful to you if you help me sir.

 
Old November 29th, 2008, 10:47 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Where are you calling this code? It compiles fine for me inside a class in a Smart Device application provided I add a using statement for using System.Runtime.InteropServices.

I haven't been able to run the code as I don't have sms.dll. I also don't know where to get it, so that's something you need to figure out.

And how is this related to ASP.NET?

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old November 30th, 2008, 05:39 AM
Registered User
 
Join Date: Nov 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi sir,
thks for ur reply..i tried to run the code in asp.net page..
i have used the namespace which u said already..u can get sms.dll in
this link..xttp://support.microsoft.com/kb/555578..replace x with h.
im unable to compile sir..y??

 
Old November 30th, 2008, 12:08 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Replace x with h? Why not just write http

Anyway, I am not 100% sure, but I think this code only works om a Pocket PC or other device as it seems to make use of device capabilities to send SMS.

For ASP.NET apps you probably need a host / service that you connect to in order to send messages.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old December 4th, 2008, 07:23 AM
Registered User
 
Join Date: Nov 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sir bcos new begineers r nt allowed to use write http..

sir i know tht it should b viewed in pocket pc..
how cn i use it to c the output??
 
Old December 4th, 2008, 08:05 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Beginners are not allowed to write http? Heuh?

And sorry, I have no idea what you're asking. Maybe you can contact the author of the article you're referring to?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help!!!!!!!!!!!!!!!!!!!!!!!!!!!! pls!!!!!!! ironchef Java Basics 2 September 26th, 2006 02:35 PM
Pls help me!! hoailing22 ASP.NET 1.0 and 1.1 Basics 4 June 10th, 2005 11:24 PM
Pls help me hoailing22 ASP.NET 1.0 and 1.1 Basics 3 May 24th, 2005 11:08 AM
Pls!!! I need your Help!!! Ariel ASP.NET 1.0 and 1.1 Basics 3 May 9th, 2005 06:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.