152 Posted Topics

Member Avatar for zachattack05

One simple way is to use a DateTime or Timestamp column. When you update the row, check the timestamp to see if it matches the value you got when you pulled the record for editing. If it does not match, you know someone else updated the record while you were …

Member Avatar for zachattack05
0
98
Member Avatar for kekela

I guess I need to understand what you are looking for. Do you want multiple pictureboxes that are clickable? Or do you want to have multiple images cycle through a single picturebox when it's clicked?

Member Avatar for jcao219
0
106
Member Avatar for reanopp

First, when you say "method isn't fired at all" - are you talking about the timer, or the method the timer is supposed to call? Can you validate that at least the timer is firing? Also, do all of the machines have the same version of the .NET Framework, with …

Member Avatar for reanopp
0
99
Member Avatar for hkBattousai

In your case, you haven't done anything with the IPEndPoint instance, so it depends. If you want to connect to a remote client (the rest of your code appears as such), you need to issue the "Connect" call from the socket, using the IPEndPoint instance: [CODE]m_socket.Connect(m_IpEndPoint);[/CODE] right after line 3 …

Member Avatar for mcriscolo
0
349
Member Avatar for onlinessp

You will want to research the .NET "Process" class. This class encapsulates many methods to handle starting and stopping processes.

Member Avatar for mcriscolo
1
82
Member Avatar for galaris

I'm assuming you mean "UDP". [CODE]byte[] data = new byte[1024]; string sData = "<the packet data - fill with what you want>"; IPEndPoint ep = new IPEndPoint("127.0.0.1", 8000); // change to the IP address and port of your server Socket gameServer = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); data = Encoding.ASCII.GetBytes(sData); gameServer.SendTo(data, …

Member Avatar for mcriscolo
0
213
Member Avatar for s0lidjacks0n

You need to define your "System" class like you did the other two; a header file to declare the class, and an implementation file to define the methods of the class. Your methods for "System" then need to be implemented like: [CODE]void System::Menu() { // Code } string System::convertUp(string& lower) …

Member Avatar for mcriscolo
0
82
Member Avatar for bill_

A couple of things: first, you are mixing your class definition and method implementations together. You need to separate these into a header file for the class definition, and a code file for the method implementations. A short example (using your "booking" class): New booking.h file: [CODE] #include <string> using …

Member Avatar for tieuyeunu
0
13K
Member Avatar for apo

Use the proper format specifier in a printf statement: [CODE]printf("%.4f", myFloatVar);[/CODE] This will display 4 positions past the decimal. See printf doc for more details.

Member Avatar for jonsca
0
130
Member Avatar for tarheelfan_08

In your loop in main(), you are using "i" as the index to the array as you insert items. How could you use "numCars" in the same way, but yet at the end of the loop, have it contain the index of the last item in the array? Also, your …

Member Avatar for tarheelfan_08
0
257
Member Avatar for cbreeze

A couple of things to look out for: 1) In your loop, you are iterating 10 times. However, your data file may not have 10 "dog" items in it. You might be better off reading until EOF. 2) Your "for" loop increments your variable ("i"), but then inside the loop …

Member Avatar for siddhant3s
0
97
Member Avatar for RayvenHawk

This site may help: [URL="http://www.webmonkey.com/reference/Color_Charts"]http://www.webmonkey.com/reference/Color_Charts[/URL] After the "#" sign, each set of 2 digits represents the Red, Green and Blue components of the color.

Member Avatar for mcriscolo
0
112
Member Avatar for free radical

You are technically already running the program, so you really only need to check to see if the user [B]doesn't[/B] want to run it: [CODE=C++]if (answer == 'n') return 0;[/CODE] Otherwise, execution will continue.

Member Avatar for free radical
0
191
Member Avatar for death_oclock

If you don't mind including <arpa/inet.h>, you can use the htonl() function: [CODE=C]int newval = htonl(origval);[/CODE] The "h" on the front is for "host" and the "n" is for network, "l" on the end for "long" (there is also a version for 16-bit integers). Hence, "Host to network Long". Network …

Member Avatar for mcldev
0
853
Member Avatar for konczuras

I take it that when you say "publish", you are using the publish command from the "Build" menu... if that's the case, then yes, when you get the output package from the Publish process, and then install it, it does install it into a subfolder of <SYSTEMDRIVE>\Documents and Settings\User\Local Settings\Apps\2.0. …

Member Avatar for konczuras
0
175
Member Avatar for mastermosley

I'm not sure what you're after. You can load XML in from a file stream. You can put XML into a string. You can read XML into a string from a file stream. Perhaps some more detail about what you're trying to accomplish will help us in guiding you to …

Member Avatar for alc6379
0
3K
Member Avatar for karthik.c

Your shell commands are off. Try this: [CODE]HEADERS = $(shell ls /root/workspace/makedemo/header/*.h) SOURCES = $(shell ls /root/workspace/source/*.cpp)[/CODE]

Member Avatar for karthik.c
0
156
Member Avatar for swinefish

You can use the WebBroswer control to display text. Drag a WebBrowser control onto your form. Put this in your Form_Load(): [CODE=C#]webBrowser1.Navigate("about:blank"); [/CODE] Then, use this code to fill it: [CODE=C#]bool bError = true; while (bError) { try { webBrowser1.Document.Body.InnerHtml = "<HTML><BODY><H1>Hi!</H1</BODY></HTML>"; bError = false; } catch (Exception exp) { …

Member Avatar for swinefish
0
129
Member Avatar for db11

Ah, but you can! Using the Controls.Find() method, you can search for an instance of a control on a form. So, if you name your text boxes "txt001", "txt002", etc., you can run code like this: [CODE=C#]Controls[] x = this.Controls.Find(sControlName, true);[/CODE] to get an array of controls that match the …

Member Avatar for papuccino1
0
2K
Member Avatar for cloud21

Perhaps you could define a base class, called "Card" that has the rank values contained within it, as cards of all suits have a rank value. Then, you could define 4 derived classes, "SpadeCard", "HeartCard", "DiamondCard" and "ClubCard". Good luck!

Member Avatar for VernonDozier
0
209
Member Avatar for blackbyron

On line 52, you are calling your function "checkAccountUsed(MAX_ACCOUNT, chk)" - I think you want to pass "val" instead of "MAX_ACCOUNT". If you look at the "if" statement in your "checkAccountUsed" function, it says if the passed in account is less than MAX_ACCOUNT - which, of course, it isn't, so …

Member Avatar for blackbyron
0
140
Member Avatar for mikhala99

Even though it's wordy, the compiler is trying to tell you something. Namely, that std::string variables can't be used in a strncmp (or other related) function. You have 2 alternatives (actually, it's C++, so you probably have 9 or 10 options, but 2 will do). 1) use the "copy" method …

Member Avatar for mikhala99
0
78
Member Avatar for snap!

Couple o' things: 1) Variables aren't initialized, then they are used (examined) later in the code. You will get unexpected results with this. 2) Your very first comparison ("if (WEIGHT <=100 && WEIGHT >= 200)") is always false. You can't have a weight that is less than 100 and greater …

Member Avatar for Nick Evan
0
174
Member Avatar for Tank50

You can select "SQL Server" to connect to a local or remote SQL Server instance. From the "Data" menu, select "Add New Data Source", select "Database", press "Next", then press "New Connection". In the "Choose Data Source" box that comes up, select "SQL Server". Once you do that, the combobox …

Member Avatar for Tank50
0
124
Member Avatar for yas9

First, you should always wrap your database code in try/catch blocks. So many things can go wrong with database code, such as connection problems, column-width issues, format conversions, etc. Opening a connection and running a command/SQL against a connection should always be in a try/catch. You have "creditvalue" defined as …

Member Avatar for yas9
0
144
Member Avatar for ctrl-alt-del

Actually, you can use control arrays, but you will have to build the TextBoxes (or any other controls) manually, rather than using the designer (unless someone out there knows a way!). Here's some code that will construct 6 TextBoxes, put them on the form and make sure they're visible: At …

Member Avatar for ctrl-alt-del
0
115
Member Avatar for iTsweetie

First, look at your "tok_vals" variable - or what you're assigning to it - use backslashes. Your counter routine is a bit off. You will never get to count the occurrences of the last item in your phrase (assuming it's unique), since the inner loop will not even execute when …

Member Avatar for nucleon
0
78
Member Avatar for ctrl-alt-del

If you'll notice, you specify "this.Controls". Those controls contain all of the controls on your form, not just the TextBox-es. You need to check the type of each control as you iterate over it, to make sure it's a TextBox. Something like: [CODE=C#]foreach (Control c in this.Controls) { if (c.GetType().ToString() …

Member Avatar for Rashakil Fol
0
110
Member Avatar for amerninja2

You can do it by creating public properties or methods on your new form (in your example, Form2). You would then show the form afterward. [CODE=C#]Form2 myForm = new Form2(); myForm.setFilename = sFile; // or, myForm.setFilename(sFile); myForm.Show();[/CODE] In the property/method, you could also call the "FromFile" method on the Image …

Member Avatar for amerninja2
0
249
Member Avatar for joejoe55

GetASyncKeyState just tells you whether a key is down. You need to get the mouse coordinates, and determine if they fall within your rectangle. For that, you will need to trap one of the mouse messages, like WM_LBUTTONDOWN or WM_LBUTTONUP (both left-mouse-button messages). The [I]lParam[/I] value of the message will …

Member Avatar for mcriscolo
0
230
Member Avatar for delifion
Member Avatar for delifion
0
88
Member Avatar for am_dumb

I can't be 100% sure, as I'm not sure where you're getting your data, but you don't seem to be doing anything with the "paramCollection" data structure. Shouldn't that be set somewhere in one of the parameters that is going into the report?

Member Avatar for am_dumb
0
3K
Member Avatar for cljlxwater

If you mean that you want to manipulate an Excel workbook from a C# Windows app, then perhaps this [URL="http://dotnetperls.com/Content/Excel-Interop-Performance.aspx"]link[/URL] will help.

Member Avatar for mcriscolo
0
95
Member Avatar for Trekker182

[QUOTE]Any thoughts? Would a while work here with the for loops? Could I take advantage of the fact that encrypt1 & 2 will always be set at four characters?[/QUOTE] You could, but shouldn't. If they throw a different length encrypt phrase at you, the code breaks. You'll need 2 for …

Member Avatar for Trekker182
0
137
Member Avatar for unk45
Re: help

In your "shuffle" function, try moving the random number seed function "srand" out of the loop. You're re-seeding the generator with the same number on each pass, since you're in and out of that routine within a second.

Member Avatar for chococrack
0
103
Member Avatar for goodmuyis

Not much to go on here, but reaching for some things to check: - Is the database (access?) installed on the new machine? - If you are indeed using ODBC, have you put the necessary ODBC entries onto the new machine (via the Control Panel | Administrative Tools | Data …

Member Avatar for mcriscolo
0
82
Member Avatar for nizbit

Generally speaking, if you're not sure of the contents of the file, or if it may contain undesired characters, you should consider reading a line of the file into a string variable or char array, and then cleaning it up (removing leading/trailing spaces, CR/LF, etc.). Then you can look at …

Member Avatar for VernonDozier
0
122
Member Avatar for minwei86

This line: [CODE=c++]fin >> romNum >> araNum ;[/CODE] It will try to pull in 2 numbers at once from your input file. It should be: [CODE=c++]fin >> araNum ;[/CODE] Since you are reading in the Arabic number. Then convert that to Roman.

Member Avatar for mcriscolo
0
102
Member Avatar for unk45

To clarify on stillearning's point: you will have to create a new string that will be the result of the string replacement. You have some issues to look out for - if the replacement string is larger than the target string, or smaller. Pseudo code would look something like [ICODE]p …

Member Avatar for mcriscolo
0
94
Member Avatar for Jennifer84

Jennifer, If you still need an answer on this, here it is: Add a ContextMenuStrip to the form and put some elements in it, then add an event handler for the "MouseDown" event, and add the following code: [CODE=C++]if (e->Button == System::Windows::Forms::MouseButtons::Right) { contextMenuStrip1->Show(e->X, e->Y); }[/CODE] That should pop the …

Member Avatar for Jennifer84
0
117
Member Avatar for Niner710

A few suggestions: [CODE=C++]void setVoltageValues(float fVcc, int iTblkLoopEnb, double dBlah);[/CODE] Or: [CODE=C++]void setVoltageVcc(float fVcc); void setVoltageTblkLoopEnb(float iTblkLoopEnb); void setVoltageBlah(double dBlah);[/CODE] However, if you change your struct, the methods above have to change. Or: [CODE=C++]void setVoltageValues(struct VoltageValues *pVV);[/CODE] Pass in a pointer to a pre-initialized VoltageValues struct and assign the internal …

Member Avatar for mcriscolo
0
157
Member Avatar for NinjaLink

In the "Daily_Average" function, you set the variable "j", like this: [CODE=C++]int j = day-1;[/CODE] but then in the loop, you do this: [CODE=C++]for (j = 0; j < 3; j++)[/CODE] thereby resetting the value of "j" back to zero. Initialize a new variable at the top of the function, …

Member Avatar for NinjaLink
0
109
Member Avatar for n8thatsme

You need to increment the "cntr" variable somewhere in your loop. You are repeatedly checking the first item of the array. Just for completeness, you know if someone types in "fred smith" instead of "Fred Smith", you will hit the end of the list without finding the item.

Member Avatar for n8thatsme
0
203
Member Avatar for chanda gul

There are actually 2 things - 1 correctly posted by Sci@phy. You must escape the backslash, so you would enter "C:\\*". The other is that the function FindFirstFile is expecting a wide character string as input. The cast was set correctly; however, you need to annotate the string constant so …

Member Avatar for chanda gul
0
151
Member Avatar for Lukezzz

Unfortunately, it's not that simple. First, be sure you change the "View" property of the ListView to "Details" so you will see your columns. Next, you need to add a ListViewItem to a ListView, like this: [CODE=cplusplus]ListViewItem ^li = gcnew("Col 1 Value"); li->SubItems->Add("Col 2 Value"); listView1->Items->Add(li);[/CODE] You can keep calling …

Member Avatar for Lukezzz
0
114
Member Avatar for tapaditap

The idea is generally there; however, there are some things you need to look at: 1) Reading & writing the entire object out - that can be problematic. What if, the first time you write out a "houses" object, the "furnished" string is set to "no"? Then the second, it's …

Member Avatar for ArkM
0
110
Member Avatar for greyghost86

Actually, the code you wrote should have looked something like (assuming other errors were corrected - code below is not correct!): [CODE]if (user_selection < Lasagna) [INDENT]cout << "Incorrect please try again";[/INDENT] else [INDENT]cout << "Good job! You guessed my favorite food!";[/INDENT] }while (user_selection != Lasagna);[/CODE] That's why you use enums …

Member Avatar for CoolGamer48
0
118
Member Avatar for Wiki_Tiki

The timer control allows you to specify a callback function that will get control whenever the timer fires. Usually when you double-click the control on the form, it will build the function stub for you. Once in the callback, you can grab the contents of the label control, convert to …

Member Avatar for mcriscolo
0
379
Member Avatar for obsolucity

One way I might think of doing this is: 1) develop an object (call it "ColumnDef") to represent a single value of one of your columns. It would contain a type property (int, string, etc), and a buffer to hold the data. 2) develop a C++/STL Map of these "ColumnDefs". …

Member Avatar for mcriscolo
0
1K
Member Avatar for ambarisha.kn

You can use memcpy to copy the various parts of one variable (or buffer) to another. Assuming that tmpbuf has your data (I assumed is was defined as "char *tmpbuf): [CODE]char tmpbuf1[2]; char tmpbuf2[2]; memcpy(&tmpbuf1, &tmpbuf[0], 2); memcpy(&tmpbuf2, &tmpbuf[2], 2);[/CODE] The variables tmpbuf1 an tmpbuf2 will contain the data split …

Member Avatar for mcriscolo
0
157

The End.