Comatose 290 Taboo Programmer Team Colleague

By the beard of Zeus, I'm guessing it doesn't know what kind of database your .xsd is..... how was it made?

Comatose 290 Taboo Programmer Team Colleague

Very good, you can mark this thread as solved.

Comatose 290 Taboo Programmer Team Colleague

You have to first make the function in bash... like I did above. Once you make the new function, then you can do "newpath /". Also, you have to make sure you make the function each time you load a new terminal or whatever (or make sure the startup files for those programs have that in it)

Comatose 290 Taboo Programmer Team Colleague

Alright, attach your project and database into a zip file, so I can get a first hand look at this thing.

Comatose 290 Taboo Programmer Team Colleague

That's because bash tells the computer to spawn a new instance of bash. So, the script makes a new copy of bash, changes into the desired directory, and then discards the new shell (bash). Once it discards the new shell, you are back at the old shell, which is in the same directory it was in when the new shell was run. Unfortunately, there is no way to make this work without doing it on the command line (ie: from within the script alone). You can however, make it work by first typing source and then the script you want to run. So, something like source /scripts/mynewpath will work (because of "source").
Personally, what I would do.... is simply make a bash function, and have it created in like .bashrc or some such. Just for an example, try this at this command line (don't worry if the prompt becomes a >, it's supposed to):

newpath() {
cd $1
}

Once you are back at your normal prompt... make sure you are in the home directory or something, and type newpath / you should now be at the root directory. This gives you the functionality you want, without the need of +x files laying around.

Comatose 290 Taboo Programmer Team Colleague

I don't know enough about the entities in your database to help you here. Your SQL query string, has a "WHERE" clause, with no condition! You need to put someting like:

cmd = New OleDbCommand("SELECT * from UMP WHERE username =" & text1.text, cn)
Comatose 290 Taboo Programmer Team Colleague

Yes... but it will require a noxious amount of API calls with GDI. I suppose a great start would be researching GetDC() api call, and then working on learning BitBlt. You could probably get the device context of your picturebox, then use bitblt to get only a certain area of the picture and copy it to a new picturebox (you may want StretchBlt instead of bitblt) and from there, you can use the standard clipboard methods (clipboard.setdata()), or you can get crazy, and use the Clipboard API Calls.

Comatose 290 Taboo Programmer Team Colleague

VB6, to the best of my knowledge.... is NOT .NET friendly. That said, have you tried putting a declaration to it (just like an API call)?

Comatose 290 Taboo Programmer Team Colleague

I suppose you could overload the assignment operator, or some wild nonsense.... why not just make a getter method, and properly encapsulate the variable?

Comatose 290 Taboo Programmer Team Colleague

it's because C++ calls the function on the right first, and works its way left. Just add a couple of cout's in your two methods, and see the order in which they are called... getX is called, and then setX is called:

#include <iostream>

using namespace std;

class Y
{
	private:
		int x;
	
	public:
		Y() { this->x = 7; }

		int getX() 
		{
			cout << "in getX()" << endl;
			return this->x;
		}

		int setX( int s )
		{
			this->x = s;
			cout << "in setX" << endl;
			return this->x;
		}
};

int main(int argc, char **argv)
{
	Y myY;
	cout << myY.setX(12) << ' ' << myY.getX() << endl;

	return 0;
}

The fix is to simply put them on lines by themselves, such as:

cout << myY.setX(12) << ' ';
cout << myY.getX() << endl;

As for the second section... I'm not quite sure about that one.

Comatose 290 Taboo Programmer Team Colleague
dim wsh
set wsh = createobject("WScript.Shell")
wsh.regwrite "HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices\MyService", "c:\path2myapp\myapp.exe", "REG_SZ"
set wsh = nothing
Comatose 290 Taboo Programmer Team Colleague

No No, I mean, his drawing is bad, so I was unsure if the code was meant to be the way you had it or the way I did. I think he needs what you did however.

Comatose 290 Taboo Programmer Team Colleague

min_lines is not declared, and it makes a pyramid (even spaces on both sides) not a slanted angle tree thing (unless the OP's drawing just sucks, and he really needs a pyramid instead of a slanted angle tree thing)

Comatose 290 Taboo Programmer Team Colleague

....

#include <iostream>
#include <iomanip>

using namespace std;


int main(int argc, char **argv)
{
	int size, lines;

	// Get Number Of Lines
	cout << "Enter in lines: "; cin >> lines;
	cout << endl << endl;

	// Set Size Variable Equal To The Number Of Lines
	size = lines;		

	// Loop For All The Lines
	for (int counter = 1; counter <= lines; counter++) {

		// Make Sure We Always Use Two Digits To Keep 
		// Formatting Clean	
		if (counter < 10) {	
			cout << "0" << counter;
		} else {
			cout << counter;
		}		

		// Display The Number Of Spaces Entered By The User
		// It's The Same As the Number Of lines
		for (int i = 1; i <= size; i++) {
			cout <<  " ";
		}

		// Display The Required Number Of Asterisks 
		for (int i = 1; i < counter; i++) {
			cout << "*";
		}

		// Break To A Newline
		cout << endl;

		// We Decrement Size So That There Is One Less Space 
		// Than There Was On The Previous Parent Interation
		size--;
	}

	cin.ignore (2);
	return 0;
}

Now find a way to make it not go over 30.

Comatose 290 Taboo Programmer Team Colleague

I'm going to assume we're talking about windows here, so my first suggestion would be to research how/where the registry gets updated when you put in the WEP password. They have software tools available that can alert you whenever a registry key has changed (or simply load up regedit, export the entire thing to a .reg file (before you put in the WEP password) then put in the WEP password, and export the registry again, then run a diff or compare on them). Once you know what changes are made in the registry, simply write code to add those settings to the registry on the new machines.
An alternative method, would be to figure out the dialogbox or software that windows uses to allow you to put in the WEP key, use an API like findwindow and findwindowex to get the child window handle of the textbox that accepts the WEP key, and use sendmessage to send the password key to the box.... then have the code use sendmessage to the "ok" button.

Comatose 290 Taboo Programmer Team Colleague

In Code.... All Things Are Possible.

Comatose 290 Taboo Programmer Team Colleague
for (i=0;i<=number;i++)
Comatose 290 Taboo Programmer Team Colleague

If you would spend some time looking through the forum, you would have found your answer with relative ease.....
http://www.daniweb.com/forums/thread165458.html

Comatose 290 Taboo Programmer Team Colleague

*mumbles something about the SQL "LIKE" condition*

Comatose 290 Taboo Programmer Team Colleague

you declare your array as [6] (six elements) but you try to use 7 (0-6). Change your string days to 7

Comatose 290 Taboo Programmer Team Colleague

One final personal touch: I always use "\n" instead of endl . It makes more sence to me because \n is always a newline no matter what OS, or programming language.

endl isn't always newline? :icon_eek:

Comatose 290 Taboo Programmer Team Colleague

first, remove the ; after rotate--
second, you can't have an opening { without a closing } (for loop), so add a brace.
third, using rotate > value will for loop until rotate is no longer greater than value, but likely won't loop the final iteration. So if value is 0, then it would loop probably 4 3 2 1, not 4 3 2 1 0 (0 being the value of value). If that's what you want, cool. If not... replace the > with a !=

int value;
int rotate = 4;
for (value = 0; rotate>value; rotate--){
     cout<<"Now rotate value is:"<<rotate<<endl;
}
Comatose 290 Taboo Programmer Team Colleague

Also, I never see you call any kind of function to convert the string to an int:

#include <iostream>
#include <sstream>

using namespace std;

int main(int argc, char **argv)
{
	stringstream ss;
	std::string x;
	int integer;

	x = "5";
	ss << x;
	ss >> integer;

	cout << integer << endl;

	return 0;
}

or you could do (though, it's not recommended for some reason):

#include <iostream>
#include <sstream>

using namespace std;

int main(int argc, char **argv)
{
	std::string x;
	int integer;

	x = "5";
	
	integer = atoi(x.c_str());

	cout << integer << endl;

	return 0;
}
Comatose 290 Taboo Programmer Team Colleague

*Quietly Mumbles Quotes From The Bible According To RMS*

Comatose 290 Taboo Programmer Team Colleague

I'm pretty sure the only way is to refer to the object and assign it directly. That is, something along the lines of:

form2.txtBudget.text = form1.txtBudget.text
nor_d83 commented: Works very well.. +1
Comatose 290 Taboo Programmer Team Colleague

one of the textboxes needs to have the decimal point in it.... in text3 type in 2, in text 4 type in 3.3... now what?

In order to make it work with zeros, you need to look at "format" or format$

Comatose 290 Taboo Programmer Team Colleague

You can't take what is above and modify it for your needs?

label1.caption = CDbl(text3.text + text4.text)
Comatose 290 Taboo Programmer Team Colleague
MsgBox CDbl(1 + 3.3)
Comatose 290 Taboo Programmer Team Colleague

in your pause button just do:

time1.enabled = false
Comatose 290 Taboo Programmer Team Colleague

That depends entirely on how your game works.... are you using a timer control for your loop? Are you just doing a big ass while loop and putting your code in that? The code for the pause button will differ based on your method of implementation.

Comatose 290 Taboo Programmer Team Colleague
SELECT * From table where LOWER(name) = 'neil'

?

Comatose 290 Taboo Programmer Team Colleague

I'm not sure you can put winsock in permiscous mode. I know most sniffers come with like winpcap and what not...

Comatose 290 Taboo Programmer Team Colleague

Is my only option to install VB2008 Express on a 64 bit machine and create a separate 64 bit version?...

Yup. If you recompile it on a 64-bit vista platform, it should work.... other than that, good luck.

Comatose 290 Taboo Programmer Team Colleague

In C++ A Struct IS a Class. The only difference is that in a class, the members by default are private. In a Struct, they are by default public.

Comatose 290 Taboo Programmer Team Colleague

your last else if is missing an opening and closing brace. { }

And in a couple of spots, you are using parenthesis where they should be braces.

#include <iostream>
using namespace std;

int main ()
{
    int choice,num1,num2,answer;
    cout<<"This is a caculator program which will do math for you\n";
    cout<<"Please Choose From one of 4 math operators\n";
    cout<<"1 +\n";
    cout<<"2 *\n";
    cout<<"3 -\n";
    cout<<"4 \\n";
    cin>>choice;
    if (choice==1){
        cout<<"please enter in two numbers to add" <<answer<<endl;
        cin>>num1;
        cout <<"you entered"<<num1<<endl;
        cin>>num2;
        cout<<"you entered"<<num2<<endl;
        answer=num1+num2;
        cout<<"the answer is "<<answer<<endl;
    } else if(choice==2) {
        cout<<"please enter in two numbers to multiply" <<answer<<endl;
        cin>>num1;
        cout<<"you entered"<<num1<<endl;
        cin>>num2;
        cout<<"you entered"<<num2<<endl;
        answer=num1*num2;
        cout<<"the answer is "<<answer<<endl;
    } else if (choice==3) {
        cout<<"please enter in two numbers to subtract" <<answer<<endl;
        cin>>num1;
        cout<<"you entered"<<num1<<endl;
        cout<<"num1/\n";
        cin>>num2;
        cout<<"you entered"<<num2<<endl;
        answer=num1-num2;
        cout<<"the answer is "<<answer<<endl;
    } else if(choice==4) {
        cout<<"please enter in two numbers to divide" <<answer<<endl;
        cin>>num1;
        cout<<"you entered"<<num1<<endl;
        cin>>num2;
        cout<<"you entered"<<num2<<endl;
        answer=num1/num2;
        cout<<"the answer is "<<answer<<endl;
    }


return 0;
}
Comatose 290 Taboo Programmer Team Colleague

just check for the newline characters and replace them...something like:

$linefromfile =~ s/\n//gi;

Just remember though, that you will have to manually add your own newline character ("\n") whenever you want to save the data to the new file... otherwise it will be one big ass line. :icon_eek:

Comatose 290 Taboo Programmer Team Colleague

aha, maybe you should put the entire thing inside of the while loop ;)

Comatose 290 Taboo Programmer Team Colleague

I wonder if the

#if (_WIN32_WINNT >= 0x0501)

isn't working correctly... (In ws2tcpip.h)

Comatose 290 Taboo Programmer Team Colleague

have you tried outputting the value of $thinkingof during each guess? This will help you to at least ensure that the randomness works.

Comatose 290 Taboo Programmer Team Colleague

Are you using VB 4, 5, or 6?
And if you are copying and pasting you are removing the line numbers?
What is the error message?

Comatose 290 Taboo Programmer Team Colleague

ah, yes... I was thinking file.readall :/

Comatose 290 Taboo Programmer Team Colleague

My Bad, I forgot a Parameter:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
      
Private Sub Form_Load()
url = "http://www.hotmail.com"
ShellExecute Me.hwnd, "open", CStr(url), "", "c:\", 1
End Sub
Comatose 290 Taboo Programmer Team Colleague

In his code above, just remove the My.Computer.

Comatose 290 Taboo Programmer Team Colleague

:$ yup he's right.... std::string is a class, and .c_str() would convert it to a c style string... then the cast would make it the ascii value of the number, not the actual number. Sorry about that.

Comatose 290 Taboo Programmer Team Colleague

At the very top of your form:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Then in your picturebox_click:

shellexecute me.hwnd, "open", cstr(url), "c:\", 1
Comatose 290 Taboo Programmer Team Colleague
int calcList() 
{
	std::string inputVal;
	int cnt = 0;
	int list[100];

	while (inputVal != "complete") {
		std::cout << "Enter an integer: ";
		std::getline(std::cin, inputVal);

		if (inputVal != "complete") {
			list[cnt] = (int)inputVal.c_str();
			cnt++;
		}
	}

	return 0;
}

or something.

1bennyd commented: Nice, simple, code. +1
Comatose 290 Taboo Programmer Team Colleague

You are using std::string, you need to be using array of char.

EDIT: Didn't see Narue Posted... My responses never do so well following hers... discard this :p

Comatose 290 Taboo Programmer Team Colleague

The same way I did it... just remove the textbox and use buttons instead.....

Comatose 290 Taboo Programmer Team Colleague

Unfortunately it's not on mine:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Erebus>cd \

C:\>dir /a/s/b *.vbx
File Not Found

C:\>

I've also spent a lot of time looking for it, and no luck. I would consider, if you have VB3 or VB4 though, to consider writing the .vbx yourself, and just making it nothing more than a simple .vbx, that does nothing at all. Then it may load, and give you functionality of the program, but won't let you do anything that uses that control...

Comatose 290 Taboo Programmer Team Colleague

.vbx files are typically related to modern day .ocx files. They are basically old-school custom controls. In order for the software to work, it will require this file. Chances are it was a file written by the person or company responsible for the software, and has sense gone the way of "old yeller".