Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Welcome Jos, there are several of us old-but-not-yet-obsolete programmers around.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It's 9:00 am at my house, so I'm eating Special K Almond with Silk Soy Unsweatened Milk

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Use substr() method e.g. if textBox1.Text.Substring(0,1) = '"' then

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Sounds like you need to format it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 12: Do not declare variables in switch statements like that, but declare FILE* at the top of main() so that it is global to the entire function.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You don't need to worry about that. Just call the registry functions and they will take care of all that complexity.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You can not easily upgrade from 32-bit to 64-bit

Link here

Q: Can I upgrade from a 32-bit version of Windows to a 64-bit version of Windows 7 or from a 64-bit version of Windows 7 to a 32-bit version of Windows?
A: You can use the Upgrade option during Windows 7 installation, which preserves your files, settings, and programs, only if you're currently running a 32-bit version of Windows Vista and you want to upgrade to the 32-bit version of Windows 7. Similarly, if you are running a 64-bit version of Windows Vista, you can only perform an upgrade to a 64-bit version of Windows 7. For more information, go to Upgrading to Windows 7: frequently asked questions on the Windows website.

If you want to move from a 32-bit version of Windows to a 64-bit version of Windows 7 or vice versa, you'll need to back up your files and choose the Custom option during Windows 7 installation. Then, you'll need to restore your files and reinstall your programs. For more information about performing a custom installation, see Installing and reinstalling Windows 7‍.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There was no such typo in my statement. Global warming, like global cooling, is a natural phenomena that occurs every so often during the Earth's history. :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Check the hwnd parameter of winproc to see if it is the label you want.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Another way to disable warnings just for specific *.c or *.cpp files is to use pragma

#pragma warning(disable: 4996)

But I like deceptikon's suggestion better.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The most portable way to do it is to use the macro toupper() and tolower(). Your program only works if the language is English and uses standard ascii character set. See this page

#include <ctype.h>

int main()
{
   char c = 'A';
   if( isupper(c) )
       c = tolower(c);
   else
       c = toupper(c);
}
Asmaa_2 commented: Thanks for your help +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Your compiled program does not contain all the code that it uses. Most of the windows code is contained in DLLs and ocx files. When you deploy your program you might also have to deploy some (or all) the DLLs and ocs files.

Before doing anything, download a copy of dependency walker (link) to find out what DLLs and ocx your program uses. Then you will have to check the target computer to find out which ones it is missing. Be careful not to overwrite old DLLs on your computer with newer versions on the target computer. You need to do version check before installing your DLLs and OCX files. If you use an auto installer such as InstallShield it will most likely do all that for you.

As an alternative, check your compiler settings and see if it will statically link the DLLs and OCXs so that they are not needed on the target computer. But that will probably double the size of your program. I don't know if vb 6 has such an option or not.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

global warming is caused by humans

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That can easily be done with .NET languages such as C# and VB.NET (see this link), but I might be terribly complicated to accomplish the same thing with win32 api functions.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 4: the array should have 10 values, not 11.

line 14: array indix values are 0 based, meaning 0, 1, 2, ... 9. There is no 10th. Count them on your fingers if you have to so that you verify to yourself that 0 to 9 is 10 values.

Also, variable num_values is not declared.

line 16: you have to put quotes around the text that you want displayed.

line 17: you need cin << array[i]; to get keyboard input

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

As long as it's neat and uncluttered any form size will do. Put too many controls on the form and many people will just get confused. Let the form be resizeable so that users can make it any size they wish.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There are lots of tutorials, just google for them (click here)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Below is a very very brief explanation. More in-depth explanation is found in this article

All programs are divided into several segments
1. code segment: This is where the program instructions are stored. When you compile your program all the instructions are stored in an area of memory called the code segment. On MS-Windows and *nix this area of memory is read-only. Any attempt to write into this area by your program will crash the program.

  1. Data segment. This is read/write area of memory where all your program's data is stored.

  2. Stack segment: This is a read/write memory segment that is used by the program to store data, function return addresses, and registry values. You can normally not write your program to specifically access this segment, instead it's reserved for use by the operating system to keep track of what instructions are to be executed.

  3. Heap segment: Read/write memory. When the program calls new or malloc() the storage area is normally taken from this segment.

The below picture (copied from the previous link) shows how a program's memory is laid out.

memorymap

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
  1. remove the spaces in scanf() format specifier string -- should be "%s", not " %s "

  2. lines 24 and 26: use array[i].name to populate the array.

tux4life commented: Always accurate and to the point. :-) +13
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Q1: I'm trying to convert a working c++ program to VB.NET 2012 just to see how networkstream works. First send a stream to web address then get response. Send seems to work ok but read() blocks (line 34 of the code). Sometimes it doesn't block but doesn't return any data either. Anyone know why that would happen?

The code originally was copied from a tutorial I found.

Q2: Why is "String" in brackets, e.g. "[String]"? Are the brackets just optional?

   Shared Sub Connect(server As [String], message As [String], ByRef x As Form1)
        Dim MyText As String
        Try
            ' Create a TcpClient. 
            ' Note, for this client to work you need to have a TcpServer  
            ' connected to the same address as specified by the server, port 
            ' combination. 
            MyText = server & message

            Dim port As Int32 = 80
            Dim client As New TcpClient(server, port)

            ' Translate the passed message into ASCII and store it as a Byte array. 
            Dim data As [Byte]() = System.Text.Encoding.ASCII.GetBytes(MyText)

            ' Get a client stream for reading and writing. 
            '  Stream stream = client.GetStream(); 
            Dim stream As NetworkStream = client.GetStream()

            ' Send the message to the connected TcpServer. 
            stream.Write(data, 0, data.Length)
            MyText = "Sent: {" & MyText & "}" & vbCrLf
            x.txtOut.Text = x.txtOut.Text + MyText & vbCrLf
            'Console.WriteLine("Sent: {0}", message)

            ' Receive the TcpServer.response. 
            ' Buffer to store the response bytes.
            data = New [Byte](256) {}

            ' String to store the response ASCII representation. 
            Dim responseData As [String] = [String].Empty

            ' Read …
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The problem is the structure, there is no memory allocated for name, that is just a pointer. scanf() does not allocate the memory.

struct data { char name[40] ; 
              int grade ;
       };
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Last year I bought a Cannon 65D just to play with. It takes great pictures and it's easy to use. Admittedly I have not learned everything yet. The only thing I don't like about it is the picture files are sooo huge that I have to crop them down in order to post them online anywhere. I wanted to buy a wide-angle photo lense for it, until I found out they cost as much or more as the camera.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When working with something as specialized as that it's best to start with their own forums and mailing lists. Posting such questions on public forums like DaniWeb is a little like trying to hit the moon with a BB gun

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

have you tried asking that question to their mailing list at help@octave.org? (link here)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

My answer is the same regardless of language. here is just one example, read the reviews at the bottom of the page.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

search amazon.com and read book reviews by other people who have bought the books.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Antidisestablishmentarianism

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Read the last couple pages of that sticky thread, there are posts only a couple weeks old.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I never ate fried pickles either! And don't intend to either.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

it's only available on Windows 8 and vb.net 2012. You can download examples from here

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Just returned from a restaurant, had Bud Light beer (non Americans probably would hate it) and hiroshima Hot Wings

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What have you attempted so far to solve the problem? Do you know SQL? What sql statement(s) are you using?

If you don't know SQL then you need to study a tutorial.

Also, post the code you have written for this question.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

because you have a rotton attitude?

Why does Michael have a rotton attitude

<M/> commented: yup :) +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I didn't see tinstaafl's post until now.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That zip file does not contain the source code. Just the *.exe and some html doc files.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I predict the earth will turn to a lump of cinder in another 2,000,000,000 years when our Sun goes super nova. But of course I could care less by then.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

LOL. That's telling her to put her money where her mouth is :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think you are right. The VK's should not be in quotes, I'm surprised it even compiled.

case VK_A: out <<"A"; break;

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I never had sex with that woman!

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't know the answer to the problem off the top of my head, but I do know that it needs to uninstall the hook before program exit to avoid system-wide crash.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Check the permissions on the folder and files to see if you only have readonly permissions. I don't know how that could have been changed, but worth a try.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Also, I totally disagree with Ancient Dragon, code completion is really nice to have regardless of skill level, and you certainly don't need to suffer the extra typing to "learn" programming properly

I learned to program a long time before intellisense was invented. I find intellisense annoying and slows down my coding. If I didn't know what methods/properties were available I had to look them up in a book, which means I learned a lot more than what I had intended to learn.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

did you try just passing the string as a second parameter as shown in the exmaple here

query.Parameters.AddWithValue("@EMP_ID",TXTEMPID.Text)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Can you calculate it with pencil & paper & calculator?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

No, I'm not alergic to it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm only alergic to pain.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

To my knowledge passwords must be plain text in the sql statement. But I'm not a DBA, they may know a way to teach the sql server how to unencrypt the password.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

get Visual Studio 2012. I have not had any problems with intellisense. IMO you shouldn't learn to probram with an IDE that has intellisense anyway, you learn a lot better and fasteer if you have to completely type everything yourself. Nothing like good repetition to pound things into your brain.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

do you mean vb10 or vb.net 2010? In this example program I posted the other day the datagrid is populated without me writing any code. The database table's column names are used for the grid's column titles. If you want something else then you will most likely have to write your own code to generate the titles.