473,836 Members | 1,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++.NET coding in window form client for interacting with WEb Serv

I have written the Web Services in VBaic .Net. One function interface:
DataSet GetAllPatients( )
which will be called in remote client and return DataSet.
I have written the clients by using both C# and VB, and they work fine. Due
to some reason, I have to use C++ in .NET IDE. Now I confuss with the use of
pointer.
I have trouble in coding and compiling. The following is my simple code,
anyone could be kind of helping me to figure out the problem. Thank you very
much.
In Form1.h file I have the code

private: System::Data::D ataSet * dsAllPatients;
private: System::Windows ::Forms::DataGr id * dgPatients;
private: WebRefFTPLocati on::FTPLocation WebService * ProxyGetAllPati ents;

private: System::Void Form1_Load(Syst em::Object * sender, System::EventAr gs
* e)
{
dsAllPatients->Clear();
dsAllPatients = new DataSet("Patien ts");
dsAllPatients=P roxyGetAllPatie nts.GetPatients ();
dgPatients->DataSource = dsAllPatients;
dgPatients->DataBindings ;

}
EORROR message:
d:\..\WebServic esClientFTP\sim pleFormClient\F orm1.h(241): error C2228: left
of '.GetPatients' must have class/struct/union type
David
Nov 21 '05 #1
2 1284
I found one bug at: dsAllPatients=P roxyGetAllPatie nts.GetPatients ();
It should be: dsAllPatients=P roxyGetAllPatie nts->GetPatients( );

But I still get runtime error when run it:
"An unhandled exception of type 'System.NullRef erenceException ' occurred in
system.web.serv ices.dll

Additional information: Object reference not set to an instance of an object.
"
What wrong with it. Thanks.

David
"david" wrote:
I have written the Web Services in VBaic .Net. One function interface:
DataSet GetAllPatients( )
which will be called in remote client and return DataSet.
I have written the clients by using both C# and VB, and they work fine. Due
to some reason, I have to use C++ in .NET IDE. Now I confuss with the use of
pointer.
I have trouble in coding and compiling. The following is my simple code,
anyone could be kind of helping me to figure out the problem. Thank you very
much.
In Form1.h file I have the code

private: System::Data::D ataSet * dsAllPatients;
private: System::Windows ::Forms::DataGr id * dgPatients;
private: WebRefFTPLocati on::FTPLocation WebService * ProxyGetAllPati ents;

private: System::Void Form1_Load(Syst em::Object * sender, System::EventAr gs
* e)
{
dsAllPatients->Clear();
dsAllPatients = new DataSet("Patien ts");
dsAllPatients=P roxyGetAllPatie nts.GetPatients ();
dgPatients->DataSource = dsAllPatients;
dgPatients->DataBindings ;

}
EORROR message:
d:\..\WebServic esClientFTP\sim pleFormClient\F orm1.h(241): error C2228: left
of '.GetPatients' must have class/struct/union type
David

Nov 21 '05 #2
most likely ProxyGetAllPati ents is null or dsAllPatients is null (never
init'd). also not sure of the following code:

dsAllPatients->Clear(); // why clear if
reassign in next statement
// and
who inits it?
dsAllPatients = new DataSet("Patien ts"); // why if next statment
dsAllPatients=P roxyGetAllPatie nts->GetPatients( );
-- bruce (sqlwork.com)
"david" <da***@discussi ons.microsoft.c om> wrote in message
news:69******** *************** ***********@mic rosoft.com...
I found one bug at: dsAllPatients=P roxyGetAllPatie nts.GetPatients ();
It should be: dsAllPatients=P roxyGetAllPatie nts->GetPatients( );

But I still get runtime error when run it:
"An unhandled exception of type 'System.NullRef erenceException ' occurred
in
system.web.serv ices.dll

Additional information: Object reference not set to an instance of an
object.
"
What wrong with it. Thanks.

David
"david" wrote:
I have written the Web Services in VBaic .Net. One function interface:
DataSet GetAllPatients( )
which will be called in remote client and return DataSet.
I have written the clients by using both C# and VB, and they work fine.
Due
to some reason, I have to use C++ in .NET IDE. Now I confuss with the use
of
pointer.
I have trouble in coding and compiling. The following is my simple code,
anyone could be kind of helping me to figure out the problem. Thank you
very
much.
In Form1.h file I have the code

private: System::Data::D ataSet * dsAllPatients;
private: System::Windows ::Forms::DataGr id * dgPatients;
private: WebRefFTPLocati on::FTPLocation WebService * ProxyGetAllPati ents;

private: System::Void Form1_Load(Syst em::Object * sender,
System::EventAr gs
* e)
{
dsAllPatients->Clear();
dsAllPatients = new DataSet("Patien ts");
dsAllPatients=P roxyGetAllPatie nts.GetPatients ();
dgPatients->DataSource = dsAllPatients;
dgPatients->DataBindings ;

}
EORROR message:
d:\..\WebServic esClientFTP\sim pleFormClient\F orm1.h(241): error C2228:
left
of '.GetPatients' must have class/struct/union type
David

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
9471
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to intercept the key so that I can do stuff on the server side to make the new window behave correctly? (We have a JSP-based webapp which stores state in the session. Now if two windows access (and modify!) the same session, then madness will result....
18
2511
by: Andrew Poulos | last post by:
If I manage to call the following bit of javascript in IE and MZ w = window.open("", "s", 'status=no,resizable=no,width=450,height=450'); I get a window that is not resizable and without a statusbar. Yet FF gives me both a statusbar and the window is resizable! Does this mean that FF does not support these "features" or is there a different way to code them for FF?
0
2308
by: Bartas | last post by:
Hi, I'am writting a simple SOAP client in python (2.4) using SOAPpy lib. I've met with this problem: when I want to send a list of complex type using some method from WebService(java,WAS), I'v got an exception:
5
8719
by: John Scott | last post by:
Ok..this a rather odd question/problem. I haven't really found a straight forward answer to how to handle this scenario, so I hope someone here can help. Here it is: I have an application that allows users to log in. Each user can have multiple roles within the application. Each role allows the user to access different sections of the app and allows/denies them certain functionality.
1
1304
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I have created a very simple window service. This window service in turn is calling a function that exist in a windows form. When I am trying to run this windows service. window service does not run and start throwing error message. Once I remove the windows form and put that same method in a class and call that class from window service, It works. I was wondering is it possible to run the window service that is calling...
19
3983
by: auratius | last post by:
http://www.auratius.co.za/CSharpCodingStandards.html Complete CSharp Coding Standards 1. Naming Conventions and Styles 2. Coding Practices 3. Project Settings and Project Structure 4. Framework-Specific Guidelines Naming Conventions and Styles
7
8642
by: =?Utf-8?B?Vmlua2k=?= | last post by:
public void sendKeysTest() { Process myProcess = Process.Start(@"C:\winnt\system32\cmd.exe"); SetForegroundWindow(myProcess.Handle); if (myProcess.Responding) SendKeys.SendWait("{ENTER}"); else
0
1645
by: micksey | last post by:
i have a form linked with access database. code goes like this: <%while not serv.eof %> <tr valign="top"> <td height="30"> <%=serv.fields("serialno") %> </td> <td> <input name="txtSCorCO" type="text" id="txtSCorCO" value="<%=serv.fields("SCorCO") %>" > </td> <td> <input name="txtPosition" type="text" id="txtPosition" value="<%=serv.fields("Position") %>"> </td> <td> <input name="txtFromDate" type="text" id="txtFromDate"...
0
1232
by: joshuajnoble | last post by:
Hi all, I'm having a strange problem where I need to build out form variables in an HTTPWebRequest and send them to an aspx page for processing. The page isn't recognizing the form variables at all, and the only thing I can attribute it to is that when the call works, the aspx page doesn't send a HTTP/1.1, Status Code = 100 response, i.e. the calls go like this: 29 1109.853516 192.168.1.108 206.71.164.82 HTTP HTTP: Request, POST /...
0
9671
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10854
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10600
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10257
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.