Comatose 290 Taboo Programmer Team Colleague
verruckt24 commented: Like the way you say it. +2
Comatose 290 Taboo Programmer Team Colleague
Comatose 290 Taboo Programmer Team Colleague
It's missing { }
edit curses.h and look around about line 559, and 1017 or so. My copy of curses.h, however includes this:
/* these names conflict with STL */
#undef box
#undef clear
#undef erase
#undef move
#undef refresh
Which in theory should fix your issue. I guess you could do something like this at the top of your code:
#define __cplusplus
should probably fix it, or even a simple #undef erase
. Anyway, let me know if it works, or if I'm crazy.
Ah.... You are posting VB.NET code in the VB 4/5/6 Forum.
First, start easy. Think about what you need, and go from there. Ok, it needs to display stuff on the form... so what do you need? You need a label or a textbox (I'd go with a label). So, put it on the form where you want the math problem to show up. What's next? Ok, they can choose between add, subtract, and multiply. Now you have to ask, can this be mixed? Can one problem be addition, and the very next be multiplication, or if they choose addition, must all the problems be addition? If the first is true (can mix and match) then you would need checkboxes no? Checkboxes indicate that out of a group, more than one option is available for selection. If they can only choose one type of math at a time, then it would need to be option (radio) buttons, which allow you to choose only one option at a time. So, next, the student should be allowed to enter an answer... sounds like a good time to add a textbox, so they can enter an answer into it. Now we have to give them an option of two different levels, 1-10 and 10-100. That certainly can not be mixed and matched, so it sounds like a great place for radio/option buttons. You might want to put command buttons (push buttons) on the form too... so the user can quit the program, probably one to reset the form to its initial state, and maybe …
set shExecInfo.lpDirectory = to the path where your .bat file resides...
Well, your code would look something like this:
#!/bin/sh
if [ "$(find /temp/ -type f | wc -l)" -gt 20 ]; then
find /temp/ -ctime 48 -exec rm -r {} \;
fi
And probably need to use \\ instead of \
Very good luck. Quickbooks is program 1. Your VB program is program 2. That is almost the same as asking how to make solitaire integrate with notepad. The simple answer is you can't. The complicated answer is, you would need to create a .dll in standard c/c++, and use .dll injection to inject the .dll into the memory space of quickbooks. Then you would need to cross-task sub-class quickbooks, and add any say, menu's or whatever that you want to interface with. Truth be told, it is probably easier to write your own quickbooks.
Your code working with the outlook object... what's it look like?
I see you set con = nothing, but where do you dim con? where do you set con?
Got +r perms on gettysburg.txt?
int _tmain(int argc, _TCHAR* argv[])
to int main(int argc, char **argv)
, but I doubt that is going to make a big difference. Just so you know, in code::blocks IDE, windows XP SP2, this compiles (and works) just fine:
#include "windows.h"
#include "shellapi.h"
int main(int argc, char **argv[])
{
SHELLEXECUTEINFO shExecInfo;
shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
shExecInfo.fMask = 0; // NULL;
shExecInfo.hwnd = NULL;
shExecInfo.lpVerb = "runas";
shExecInfo.lpFile = "notepad.exe";
shExecInfo.lpParameters = NULL;
shExecInfo.lpDirectory = NULL;
shExecInfo.nShow = SW_MAXIMIZE;
shExecInfo.hInstApp = NULL;
ShellExecuteEx(&shExecInfo);
return 0;
}
Although, the runas portion comes up with a dialog box... wanting me to ok it and login or whatever... but I'm sure if we can pass something like "/password" or whatever runas takes to lpParameters, we should be able to make it happen seemlessly.
:$ I see your point.
I'm going to wager a guess here. I'll bet that you didn't refresh the page after ArkM posted. So, picture this... you go to C++ forum, you get a list. The last poster at the time was vmanes.... ArkM Posts (before you click vmanes) and voila. Now, look at the status bar of your browser while your pointer is over the link (check your pictures too). You'll see that the link has nothing to do with a member profile at all. It has to do with the last poster. http://www.daniweb.com/forums/member.php?find=lastposter&t=176980
, looks to me like the link says "hey, get the profile of the last poster on thread 176980, regardless of who it is."
Well I guess I said strip (cut out), but you could also use sed or awk to replace the newlines with some other characters. I say characters, because if you do a simple character, you won't know if it is an original character, or if it is a replaced character... but if you replace every instance of \n with _:_ for example, then in your CSV file, all the _:_'s represent a \n. |+| for all of your \r's. Then, Translate them back before you try to use them (or is that not possible)?
you could use split to divide the sentence into words. Something like:
dim x as string
x = "this is a sentence."
parts = split(" ", x) ' might be split(x, " ")
now parts(0) should be "this".
At the top of your header, you have:
#ifdef shape_h
#define shape_h
that should really be ifndef
. Why define it if it is already defined? ;)
Also, you don't have "draw" defined in your class definition for Square. Lastly... you are missing an int main :icon_eek:
I'm pretty sure you can use awk to strip the \r and \n's....
First of all, you need to use code tags. You can do this by typing:
[code=vb] 'your code goes here
[/code].
This will make your code more clear and easier to read and debug. Please repost using code tags.
you should put your code in code tags. Look ssomething like this:
[code=vb] ' your code goes here
[/code]
Will Look like this (how we like it):
'your code goes here
That said, somewhere in your form, probably on form load, (you usually only need to do this once, doing it more than once may cause a performance hit):
Randomize Timer
Uh, yeah. Instead of "end", have a global Boolean variable. Have it set to like false.... then in button2, have it says something like flag = true
, then in button1, have an if or something like if flag = true then exit sub
. Or something.
I'm going to need to see your code then, in order to be able to troubleshoot this further.
You can not create a thread in Visual Basic 4/5/6. Doevents is only a partial fix to your problem. Doevents tells VB that a long ass loop is going on, and that it needs to do other stuff too, like handle mouse clicks. So, just for example, make a form and put 2 buttons on it....in button1, put this:
while 1 = 1
x = 200 * 200
wend
Then, in button2, put this:
end
Now run the code, and click button1. Now Try to click button2. Nice Huh? Now modify button1 to have this:
while 1 = 1
x = 200 * 200
doevents
wend
Run the code, click button1, now click button2..... oh wow. Big difference.
You should post your code in code tags, like so:
[code=vb] your example code here
[/code] ;)
*Mumbles something about std::reverse()*
.....
you can't declare methods of a class without a return type. You seem to think that "setDate" doesn't have to return a value. Ok, I can respect that. How 'bout you make it return a void type. Only ctors and dtors can skip return values (and I think must)
class date
{
private:
int d; // Day
int m; // Month
int y; // Year
public:
date();
setDate(int d, int m, int y); // Really?
void setDate(int d, int m, int y); // Better.
};
Do this for all of your messed up lines, and the original error you found ( missing ; before * ..
) will go away when you fix all the other errors. Don't count on it happening right away either.... you have a circle jerk of classes that all refer to each other.... barrower refers to copy inside of it's members, while copy refers to barrower in it's class definition... which came first the chicken or the egg?
Redesign your entire project, using some kind of UML or Flowchart, and try again.
*Point Above*
You were assigning the value of the caption to the textbox, not the other way around. You can do this:
dim x
x = 5
you cannot do this:
dim x
5 = x
These are not interchangeable....It only works the first way. So when you put:
form1.text1.text = form2.label1.caption
you are saying (with no exception) "I want text1 to now contain the data stored in label1".
You should edit your post and put your code between code tags (don't put the spaces I used between [ and ])
[ code=cplusplus ]
your code here
[ /code ]
aha! No Caption Set Yet!
I guess you could put your entire project on here as a .zip file.... the code you have there, I see nothing wrong with. It is perfect.
:) Glad you got it solved. If so, you can mark this thread "solved" down at the bottom.
Code::Blocks
The problem is that the procedure (function or sub) called PHYSPROP, expects something other than a double. Are you sure it's VV(), or is it possible it is the 1, 0, 0, 0, 0, 0, 1?
Don't use GunBound's handle. What I've found is that as long as the window is active on the screen HWND_DESKTOP will work for sub-windows too. In fact, to test it (the code as posted), I opened ms paint, drew a box and colored it with the paint fill thing. Then I moved the window so that it was at YPos 100, and run the app. It found it at the appropriate position. Have you tried it just as it is?
If it were windows itself, don't you think cmd.exe (which is a windows program) would support it? I would imagine so. According to MSDN (I was holding off on it, but will post it when I get home) they say it's the API functions that translate the / slashes to \ slashes. That would mean it's not windows itself (ie: the file system) but the programs that are running on it (ie: explorer.exe, and so forth). Just for fun, try this:
start, run, type in: /
Oops.
Start, run, type in: \
interesting.
http://www.cygwin.com/cygwin-ug-net/using-effectively.html <<-- Under Pathnames
And straight from the horse's mouth:
http://msdn.microsoft.com/en-us/library/aa989022(VS.80).aspx
You can mark this thread as solved :)
Oh For The Sake Of Pete:
#!/usr/bin/perl
$filepath = "./file.dat";
# Get Data From File Into Arrays
open (FH, "$filepath");
while (<FH>) {
($stamp, $part1, $part2) = split(/\s+/);
push @stamps, $stamp;
push @parts1, $part1;
push @parts2, $part2;
}
close (FH);
$array_size = @stamps;
for ($i=0; $i < $array_size; $i++) {
print "$stamps[$i] $parts1[$i] $parts2[++$i]\n";
}
How about attaching a portion of the file?
Just remember, you must either put this function above the main function, or you must put a function prototype above the main function (so main knows how it's supposed to look when you try to use it).
basically a function looks like this:
return_type function_name (type variable, type variable)
{
return return_type;
}
So, let's do the first one, sum. What does it need to return? I'd say an int (though a double is probably needed) So look at the return value... it needs to return an int so:
int sum(int value1, int value2)
{
int result;
// calculate sum here
return result;
}
This says, the function returns an int, it's name is sum, and it takes 2 parameters, an int called value1 and an int called value2. You should be able to go from there.
EDIT: when you want to use the function from like, main. You need to call it like this:
int x = 5;
int y = 5;
int retval = sum(x, y); // retval will be the sum of 5 and 5
Me Too.... does it work with ShellExecuteEx?
Really? Negative Rep For A Rick Roll? ;)
You might need to modify the constants a little, because the color you gave me isn't yellow at all.... it seems more like diarrhea orange (sorry for that). Anyway, this code works for me on windows XP Sp2, Code::Blocks IDE wth Mingw. It is overly commented for your sake, and a little untidy... but I'm sure you can handle it.
#include <iostream>
#include <cstdio>
#include <windows.h>
using namespace std;
int main(int argc, char **argv)
{
// Device Context, Point Struct, and Color Struct
HDC hDC = GetDC(HWND_DESKTOP);
POINT pt;
COLORREF rgb;
// Numbers To Compare Against
const int CMP_R = 214;
const int CMP_G = 186;
const int CMP_B = 99;
// Values As byte
BYTE rVal;
BYTE gVal;
BYTE bVal;
// Same Values As Integers
int red;
int green;
int blue;
// Set This To Your Known Y Coord.
// Pretty Sure 0,0 Is Top Left
// Corner Of The Monitor.
pt.y = 100;
// Loop To 3000... Adjust For Higher
// Resolution (Really?)
for (int i=0; i < 3000; i++) {
pt.x = i; // Next Pixel
// Moving From The Left To The Right,
// Get The Pixel
rgb = GetPixel(hDC, pt.x, pt.y);
// Save Pixel Color In Byte Values
// This Step Might Not Be Necessary..
// Coult Probably Get It As An Int
rVal = GetRValue(rgb);
gVal = GetGValue(rgb);
bVal = GetBValue(rgb);
// Save Pixel Color As Decimal
red = (int)rVal;
green = (int)gVal;
blue = (int)bVal;
// Do All The Colors Match Our …
Antibiotics only help against bacteria...
Uh Oh.... then I guess we are in a world of hurt.
guess it's not happy about passing it a parameter.... I guess you could try:
ShellExecute (NULL, "open", "cmd.exe msg.bat * hej", "", "c:\\", SW_NORMAL)
but I have a really strong feeling that isn't going to fly...
then doevents should work just fine.... somewhere when your form1 is doing processing... probably in some kind of do loop or while loop or for loop, simply stick a doevents.
for i = 0 to 1000000
retval = i * i
doevents
next i
ShellExecute (NULL, "open", "cmd.exe", "msg.bat * hej", "c:\\", SW_NORMAL);
Antibiotics anyone..... antibiotics?
maybe you should consider trying it with cmd.exe. Use cmd.exe as the program and the bat file as a the parameter. I'm pretty sure UAC is the reason for it not working....
,but i still think its silly to make such a big deal about something so little.....
It's not really so little. It's garbage in fact. I'd guess that 80% of the time the thread is solved and marked as such. So, the vast majority of the time people are posting to an old thread, there has already been a resolution.... there isn't much more you can contribute to that. Problem, discussion, resolution... now, even people who run across the thread from a search engine, with the same problem have everything they need... "oh that's my problem too... and this is how it was fixed". Then you get the people who have a similar problem, but it's not the same problem... and instead of posting a new thread, they simply hijack the solved one. I guess you can count that to pure laziness, which shows a little something about the person requesting help... quite frankly, I don't want to help lazy people. They want me to do their homework for them. If that were the end of it, ok... but it's not.
It gets even worse if you like to be notified about recent posts to threads you've helped in. Now I get notification messages about problems I already fixed.... years ago. It would be one thing, if it wasn't a solved thread... but even that was abandoned, and probably because it wasn't an original question, and the only response was a link to the same problem with a solution... …
Usually this is done by building yet another exe program. That one basically is a menu of some kind, and when you click the selected option, it launches the exe that user wants to choose.