Forum: C++ Apr 8th, 2009 |
| Replies: 2 Views: 1,380 This is a general question.
I am familiar with accessors and mutators (getters and setters). I have now been reading up on semaphores. I am having trouble finding out differences between... |
Forum: C++ Mar 27th, 2009 |
| Replies: 1 Views: 229 Does anyone know how to delare a managed class in unmanaged code? This is driving me nuts, because I can call unmanaged from managed, but not the other way. Is there a way to do this? Thanks in... |
Forum: C++ Mar 26th, 2009 |
| Replies: 5 Views: 330 Thanks all.
MrSpigot, how would I then access the structs through the pointer?
pFoo->test[0].index = blah; does not work. How would this be done?
Thanks. |
Forum: C++ Mar 26th, 2009 |
| Replies: 5 Views: 330 I have a struct. I want to declare a pointer to that struct. Now I want 10 of those structs. How is this declared? I have tried (call the struct foo for example):
foo* test[10];
when I make... |
Forum: C++ Mar 16th, 2009 |
| Replies: 0 Views: 164 I have an vs2005 forms application running a thread to constantly try and receive data via ethernet. My problem is once I get the data I want to pass it up through some object oriented layers. When... |
Forum: C++ Nov 7th, 2008 |
| Replies: 4 Views: 867 I am writing to a text file. Everything is working fine, except I can not figure out how to start a newline. I have tried
fprintf(txtFile, "%s", "\n");
fprintf(txtFile, "%s", '\n');... |
Forum: C++ Nov 6th, 2008 |
| Replies: 3 Views: 349 what I want is something like this
char buffer[10];
buffer[0] = 0x5F;
TextBox->Text = buffer[0];
i need to cast or a function to convert or something that I dont know about to get the text... |
Forum: C++ Nov 6th, 2008 |
| Replies: 3 Views: 349 I have a buffer of chars. I want to display them in a text box as hex. is there a simple way to do this? Thanks. |
Forum: C++ Oct 16th, 2008 |
| Replies: 1 Views: 385 I want to delete a bitmap. How do I do this in c++.
DestBitmap->Save("TempImage2.bmp");
.
.
.
.
.
//later something like
Delete("TempImage2.bmp"); |
Forum: C++ Oct 1st, 2008 |
| Replies: 3 Views: 468 I am drawing on a bit my, then re-loading the bitmap(to erase it) then drawing on it again at 100Hz. I am getting flicker. Is there a way to reduce this flicker? Or a better way to do this than to... |
Forum: C++ Sep 18th, 2008 |
| Replies: 2 Views: 1,244 This is the code I use to load the image
Map->Image = System::Drawing::Image::FromFile("test_map1.bmp");
Map->Height = Map->Image->Height;
Map->Width = Map->Image->Width;
Map->Left... |
Forum: C++ Sep 18th, 2008 |
| Replies: 2 Views: 1,244 How do you draw on an image in visual studio 2005 and get it to stay? Ive can get it to draw, but it flickers on resize and disappears when the resize is done. Any ideas? |
Forum: C++ Sep 10th, 2008 |
| Replies: 4 Views: 525 How would one seperate a decimal into 2 numbers, the left and right sides of the decimal?
float example = 131.14567
into...
int left = 131
float right = .14567
thanks. |
Forum: C++ Sep 8th, 2008 |
| Replies: 3 Views: 711 |
Forum: C++ Sep 8th, 2008 |
| Replies: 3 Views: 711 I am attempting to read a text file.
ifstream indata;
indata.open(filename);
if(!indata)
{
// file couldn't be opened
}
else
{ |
Forum: C++ Aug 13th, 2008 |
| Replies: 4 Views: 732 |
Forum: C++ Aug 13th, 2008 |
| Replies: 4 Views: 732 In borland I could place a picture box on the scrollbox and it would take care of scrolling. I was wondering if there is a "scrollbox" to place my picturebox on in windows forms to do the same... |
Forum: C++ Aug 13th, 2008 |
| Replies: 4 Views: 732 Does anyone know if vs2005 has the borland equivilent of a "scrollbox"? Thanks. |
Forum: C++ Aug 6th, 2008 |
| Replies: 1 Views: 988 I am trying to run a simple program to read ethernet using UDP. Here is the code, but it always receives -1 for 'error', but I did it by the book. Do you guys see the problem? Thanks.
//enum... |
Forum: C++ Jul 30th, 2008 |
| Replies: 3 Views: 512 ok, thanks. Also, If I am passing a class into my thread function, and use the same class in a different thread, but a different function of the class, can they operate in parellel, or would I... |
Forum: C++ Jul 30th, 2008 |
| Replies: 3 Views: 512 When can you determine if you are using too many threads? Assuming I have complete control and mutex locks and what not, when does it slow my program down, rather than speed it up by splitting up... |
Forum: C++ Jul 29th, 2008 |
| Replies: 2 Views: 933 I am running a thread that does something, then sleeps for a while. If the program closes it continues to sleep to completion. How do I get it to abort immediatly, even if in the middle of... |
Forum: C++ Jul 24th, 2008 |
| Replies: 1 Views: 391 I am attempting to use a queue. I am doing it just like an example i read. I am doing a vs2005 form applicaiton.
#pragma once
#include <queue>
public ref class DataSource
{
public:... |
Forum: C++ Jul 22nd, 2008 |
| Replies: 8 Views: 558 The problem had to do with the optimization. Once I took it from "maximize speed" to "no optimization" it worked fine. Dont know how that effects everything optimization wise, but for now it will... |
Forum: C++ Jul 22nd, 2008 |
| Replies: 8 Views: 558 It is really basic code, a while(1) in a thread, that calls a function. I have even tried copying and pasting the contents of the function and it skips all that. Tried cleaning, you name it ive... |
Forum: C++ Jul 22nd, 2008 |
| Replies: 8 Views: 558 Has anyone ever seen a function call just get skipped? I am running in debug mode and it wont let me set a break point on the call and when i step to it it goes right over to the next line, no... |
Forum: C++ Jul 22nd, 2008 |
| Replies: 5 Views: 469 is there a way to do this same thing, only with a short.
char buffer[512] = "Hello World";
// allocate memory for the new string
word* ptr = new word[strlen(buffer)+1];
// now copy... |
Forum: C++ Jul 22nd, 2008 |
| Replies: 5 Views: 469 I am trying to put the contents of a char buffer[512] into a word* (type def as data type short). How do I do this? I have tried memcpy but am either getting an exception or it will run but the... |
Forum: C++ Jul 21st, 2008 |
| Replies: 1 Views: 360 I have a vs2005 forms app, I have added a header file with a bunch of functions, but now i get a bunch of LNK2005 errors, one for every function. How do I resolve this? Do I need to put them in a... |
Forum: C++ Jul 15th, 2008 |
| Replies: 0 Views: 720 I am using the winsock component in vs2005. I have tried sending and recieving strings. The event of data arriving triggers and runs the following code...
private: System::Void... |
Forum: C++ Jul 14th, 2008 |
| Replies: 0 Views: 350 In vs2005 there is a winsock component, how do you receive data using the component? I found a ->SendData(blah), but cant find a receive. Does anyone know how to receive with this component? ... |
Forum: C++ Jul 1st, 2008 |
| Replies: 2 Views: 467 |
Forum: C++ Jul 1st, 2008 |
| Replies: 2 Views: 467 I am trying to open 2 forms when I start my vs2005 project. The main form, and a second form whose class is created, and then ->show. It shows both forms, but you can control either one. What I... |
Forum: C++ Jun 19th, 2008 |
| Replies: 1 Views: 429 I have a program with a bunch of threads running. I kill them all at the end of the program. I have stepped through and seen them all abort. Is there a way to see (since I cant when stepping... |
Forum: C++ Jun 18th, 2008 |
| Replies: 2 Views: 1,149 I want to read each line of text file and store each line into a giant buffer so I can look at all the contents. How would I do this?
int _tmain(int argc, _TCHAR* argv[])
{
ifstream indata;... |
Forum: C++ Jun 10th, 2008 |
| Replies: 0 Views: 310 I have a server running using winsock2.h TCP/IP. I open two ports on my pc, and then in a different application connect and send and receive to and from the server respectivly. In my client... |
Forum: C++ May 28th, 2008 |
| Replies: 3 Views: 351 Hit the button too early, I edited it. :) |
Forum: C++ May 28th, 2008 |
| Replies: 3 Views: 351 private: delegate System::Void delegate_function(void);
if(this->InvokeRequired)
{
AsyncCallback ^ac = gcnew AsyncCallback(&WCS::MainForm::delegate_function_callback);
delegate_function ^df =... |
Forum: C++ May 23rd, 2008 |
| Replies: 1 Views: 346 I am using the begininvoke and endinvoke methods in visual studio 2005.
private: System::Void button_run_Click(System::Object^ sender, System::EventArgs^ e)
{
... |
Forum: C++ May 23rd, 2008 |
| Replies: 0 Views: 351 String^ comPort = "COM" + this->RS232CommPortNum->Value;
int baudRate = Convert::ToInt32(this->cbBaudRate->Value);
com = gcnew SerialPort(comPort, baudRate);
try
{... |