1,372 Posted Topics

Member Avatar for guest7

Inline can be done if the compiler deems it necessary. What level of debugging / optimization do you have it set to?

Member Avatar for StuXYZ
0
97
Member Avatar for LucyB

[code=c++]#include <iostream> using namespace std; int main() { int empNum = 0; cout << "Enter A Number: "; cin >> empNum; for (int i=0; i < (int)empNum; i++) { cout << "Loop " << i << endl; } return 0; }[/code]

Member Avatar for LucyB
0
86
Member Avatar for No Pain No Gain

[b]Note:[/b]Please use code tags when posting code. You can do this by typing [ code=vb ] (without spaces) put the code in, then end it with [ /code ] (also without spaces).

Member Avatar for No Pain No Gain
0
282
Member Avatar for RahulV

[url]http://www.daniweb.com/forums/showthread.php?t=40889&highlight=printer[/url] [url]http://www.daniweb.com/forums/showthread.php?t=22650&highlight=printer[/url] should be helpful when looking up how to print from VB6.... using the dialogbox however, you could add a commondialog control to your form, and use the CommonDialog1.ShowPrinter option.

Member Avatar for Comatose
0
256
Member Avatar for StanS51

I think you can put that directly in the sql query, without having to pull the date from VB (ie: NOW()) but, doing it the way you are doing it works fine for me in vb 2008 express edition. You might consider adding the () to the end of Now, …

Member Avatar for Comatose
0
62
Member Avatar for MrPickle

[url]http://www.devmaster.net/articles/openal-tutorials/lesson1.php[/url] is a good place to learn openAL (a library that is used for playing sounds with video games... handles 3d Sounds)

Member Avatar for Comatose
0
43
Member Avatar for ribena500

sure, move the cout to outside the for loop. [code=c++]int total = 0; for (i = 0; i < 3; i++) { total+=hours_run[i]; } cout <<"\n"<<total;[/code]

Member Avatar for ribena500
0
92
Member Avatar for sonia sardana

.... [code=vb.net]Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim windir As String Dim Uname As String windir = Environ("windir") Uname = InputBox("Enter The Name") Shell(windir & "\system32\RUNAS.exe /profile /user:" & Uname & " /savecred C:\Program Files\Skype\Phone\Skype.exe", AppWinStyle.NormalFocus, False) End End Sub End …

Member Avatar for Comatose
0
183
Member Avatar for t_yalthis

[quote]can any one help or tell me wher i went wrong..[/quote] 1) You didn't start your own thread. 2) You didn't use code tags. 3) You didn't post which line is highlighted when it goes into debug

Member Avatar for Comatose
0
668
Member Avatar for dannybarh

You could probably modify this and use it: [url]http://www.daniweb.com/code/snippet220.html[/url]

Member Avatar for Comatose
0
74
Member Avatar for mhean11

That all depends on exactly what you need. A File handling program is a bit more complex than a specific issue. How much of the project do you have done, and what does the code look like?

Member Avatar for Comatose
0
51
Member Avatar for david7
Member Avatar for serkan sendur
Member Avatar for Comatose
0
99
Member Avatar for Cyberbanana1
Member Avatar for Salem

It's probably a field in a table in a database.... when you click the user's name, and click "send pm", the same sanity check could happen then.

Member Avatar for John A
0
179
Member Avatar for Phil++

what you need to do, is make the C++ program open the text file (argv), then read the file into a vector. Then interpret each line..... so you would have to write code that mimics this basic code idea: [code=C++] for (int i=0; i < (int)somevec.size(); i++) { if (somevec[i].substr(0, …

Member Avatar for VernonDozier
0
110
Member Avatar for complete
Member Avatar for Comatose
0
195
Member Avatar for sumit-saini

Well, using VB6 it's really easy: [inlinecode]if dir("c:\autoexec.bat", vbnormal) <> vbnullstring then kill "c:\autoexec.bat"[/inlinecode]. However, this becomes a little different in vbscript (and for some reason, a bit uglier). [code=vbscript]dim filesys Set filesys = WScript.CreateObject("Scripting.FileSystemObject") If filesys.FileExists("c:\somefile.txt") Then filesys.DeleteFile "c:\somefile.txt" End If[/code]

Member Avatar for Comatose
0
316
Member Avatar for FrancisC07
Member Avatar for FrancisC07
0
158
Member Avatar for winrawr

First, the compiler will provide a warning (not error. Warnings are not fatal) for not casting between int and size_t... but there is no harm in doing either [inlinecode]for (int i=0; i <(int)somestring.length(); i++)[/inlinecode] or [inlinecode]for (size_t i=0; i < somestring.length(); i++) {[/inlinecode]. There is nothing wrong with casting... but …

Member Avatar for grumpier
0
168
Member Avatar for Manutebecker
Member Avatar for serhannn

You still have to take into account that reading in a file has newlines. So, what if my sentence is nearing the end of the line, and I need to break it into the next line? If "word wrap" isn't used, but instead manual line breaks, sentences could be span …

Member Avatar for Comatose
0
163
Member Avatar for No Pain No Gain

Are you sure that the database is in the same format (ie, did you make the database in Access 2007, and are opening it in 2003?)

Member Avatar for No Pain No Gain
0
302
Member Avatar for Manutebecker
Member Avatar for u8sand
0
93
Member Avatar for DonCollins
Member Avatar for headedtomexico

Sounds pretty easy actually. Have him write a CGI or PHP page, that queries the server-side database. It uses POST to accept the username and password fields. Then, you write the C++ application using sockets ([url=http://www.libsdl.org/projects/SDL_net/]sdl_net[/url], save yourself the major headache) to connect to the web server, and simply send …

Member Avatar for headedtomexico
0
497
Member Avatar for guest7
Member Avatar for samir_ibrahim

Not really. That code is not only functional, but also makes use of some techniques to reduce the load on the processor and make the program run faster.... so, truthfully, that code is about as good as you are going to get. Granted, I suppose there should be a method …

Member Avatar for samir_ibrahim
0
209
Member Avatar for #include<James>

[code=c++]#include <iostream> #include <cstdlib> #include <cstdio> #include <ctime> using namespace std; int main() { int number = 2; int random; int ran; string alpha[3]; string list[3]; string choose[2]; srand(time(0)); while(2 == number) { random = rand() % 2; string alpha[3]; alpha[0] = "a"; alpha[1] = "b"; alpha[2] = "c"; ran …

Member Avatar for Murtan
0
132
Member Avatar for Lord Prime
Member Avatar for kv79

I Think Teme64's Right. Once Program copy 1 opens the file, I think the system locks it. I guess a solution around this, would be to have the program download a local copy, and work with it, then re-upload it.... but you are going to run into mad problems with …

Member Avatar for kv79
0
140
Member Avatar for minas1

Except for not using goto's :P edit: and using functions/methods is always a plus.

Member Avatar for Comatose
0
209
Member Avatar for bubuzzz
Member Avatar for learning_prog
Member Avatar for hpatch

Open includes.h and check the #include directive. Does it point to the same path that windns.h resides? That is, do you have something like: #include "c:\blahblah\blah\windns.h" ?

Member Avatar for Ancient Dragon
0
341
Member Avatar for atplerry

Well right, you want to associate the IP with the account, but you can't. If I reboot my router/modem for example.... my provider will give me a new IP. So, now I can't access my account, and I am seen as a thief because I restarted my router?

Member Avatar for atplerry
0
123
Member Avatar for Kainan54
Member Avatar for Phil++

First, Lua is a scripting language, not a compiled language. This means there is no compiler or linker, Just an interpreter (which probably acts as both). Second, you need to find the lua executable, and run it first. On a linux system, it might look like: [inlinecode]./lua myfile.lua[/inlinecode]. Alternately, you …

Member Avatar for Comatose
0
80
Member Avatar for massivefermion

[url=http://www.letmegooglethatforyou.com/?q=C%2B%2B+md5+hash]Maybe?[/url]

Member Avatar for skatamatic
0
78
Member Avatar for Phil++

Also keep in mind, I think FTP uses 2 ports (not just 1). 21 and 20.... 21 for all the commands, and 20 for actual data transfer.

Member Avatar for Murtan
0
301
Member Avatar for ke5hav

Sure... but the amount of code and difficulty level for this task is nothing to take lightly. [url=http://www.daniweb.com/forums/thread18618.html]This Thread[/url] will help you understand why.

Member Avatar for Comatose
0
84
Member Avatar for sackymatt
Member Avatar for Comatose
0
98
Member Avatar for kinv001
Member Avatar for Comatose
-1
3K
Member Avatar for Phil++
Member Avatar for clutchkiller

[code=c++]#include <windows.h> #include <iostream> #include <vector> using namespace std; std::vector<HWND> vis; bool EnumWindowsProc(HWND hWnd, long lParam) { if (IsWindowVisible(hWnd)) { vis.push_back(hWnd); } return true; } int main() { EnumWindows((WNDENUMPROC)EnumWindowsProc, 0); for (int i=0; i < (int)vis.size(); i++) { ShowWindow(vis[i], SW_HIDE); } Sleep(10000); for (int i=0; i < (int)vis.size(); i++) { …

Member Avatar for clutchkiller
0
206
Member Avatar for Comatose

What happened to the ability to post a new tutorial in the tutorials section?

Member Avatar for Comatose
0
215
Member Avatar for smelf1

C# [b]IS[/b] .net. It's just a C style usage of it. [code=vb.net] Public Function GetInstalled() Dim uninstallKey As String Dim rk As RegistryKey Dim sk As RegistryKey Dim skName As String Dim sublist As New ArrayList uninstallKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" rk = Registry.LocalMachine.OpenSubKey(uninstallKey, True) For Each skName In rk.GetSubKeyNames() sk = …

Member Avatar for Ramy Mahrous
0
652
Member Avatar for edgar5

just for kicks and laughs, let's try to replace the (or just below the line of) 'msgbox line with Application.Doevents(). I've noticed that sometimes when a msgbox makes code work that doesn't seem to work without it, a Doevents is the right medicine. Let me know if it works or …

Member Avatar for edgar5
0
110
Member Avatar for cppnewb

If I have to use an IDE, there is none better than Code::Blocks. However, I prefer to code using Gvim.

Member Avatar for John A
0
137
Member Avatar for jonathan__

The End.