Member Avatar

My code was working Great! until i added a vector named "resudibus"to my namespace in a windows form. #pragma once #include <Windows.h> #include <msclr\marshal.h> #include <iostream> #include <string.h> #include <vector> #include <fstream> using namespace std; using namespace System; using namespace System::IO; using namespace msclr::interop; namespace Project1 { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Summary for MyForm /// </summary> std::vector<int> resudibus(1); it gives me the following error messages : WinCLI.obj : error LNK2005: "class std::vector<int,class std::allocator<int> > Project1::resudibus" (?resudibus@Project1@@3V?$vector@HV?$allocator@H@std@@@std@@A) already defined in MyForm.obj 1>fatal error LNK1169: …

Member Avatar
0
20
Member Avatar

I am having a dialog box opens that lets you select a picture and then copy that picture to another folder but the problem is that i am having an error that says that i can't convert a System::String to a LPCTSTR. I searched this subject on google but i spent the whole day trying to figure it out. How should i convert a System::string to a LPCTSR? if ( openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK ) { strpic=openFileDialog1->FileName; CopyFile(strpic,L"pic/",false); }

Member Avatar
0
15
Member Avatar

Hey guys, I am having a problem where i want to print a image and a simple string. i would want that when i print i get this on paper : [Click Here For Image](http://img339.imageshack.us/img339/9308/wiw.png) I looked up printDocument, printDialog and printPreviewControl from MSDN and got a few examples but i did not really understand them, i looked up this topic on Google but its very little discussed. I don't know the procedure on how to print to paper so if someone can explain to me how its done it would be very appreciated or if you can make an …

Member Avatar
0
24
Member Avatar

Hey guys, You know when you are about to buy an item online you have to insert your address, etc and after a few days you will receive the product at the address you provided. Well i am setting up an online business that offers products but i am stuck because i don't know where i should go or which companies offer these kind of services. If you know any companies that offer these services pleas let me know and if you had experience with any of them also let me know as it would be great. Thank you in …

Member Avatar
0
4
Member Avatar

I have been trying to capture the enter key in a windows.net textbox but i have no idea how to do it, i googled searched but the only examples i find are visualbasic and c# ones and when i try to do thesame thing in c++ in doesnt work. I am using visual c++ express 2008 and i am working with windows forms(.net) I hope thats enough information for you guys to be able to help me. Thanks in advanced.

Member Avatar
0
5
Member Avatar

Hi all, I add picture to my pictureBox by writing the following code : [ICODE]pictureBox->BackgroundImage = System::Drawing::Image::FromFile()[/ICODE] But how would i remove that image ones i am done using it? Thank you in advanced.

Member Avatar
0
6
Member Avatar

How would i get an imageBox Background image file location ? Thanks in advanced.

Member Avatar
0
6
Member Avatar

Hey guys, How would i get an imageBox Background image file location ? Thanks in advanced.

Member Avatar
0
5
Member Avatar

How do i get the number of items a itembox is carrying? I tried [CODE]MessageBox::Show(listBox1->Items);[/CODE]but no luck Thanks in advanced.

Member Avatar
0
12
Member Avatar

Hey, i have a CLR proyect where i have 2 forms, i am trying to acces the form1 class via form2. what i did is that i included the header.h of the form in form.h but it failed so i went back and icluded thesame folder both of them are there and then it compiled fine. then i tried to acces form1.h but it doesnt locate anything in the header so then i made a function in form1.h and not even that it wont located it wont locate.

Member Avatar
0
4
Member Avatar

I am trying to write \r\n as a string but when i do it apears as a newline. Here is the code i am using : [CODE]textBox1->Text="test"+"@\r\n";[/CODE] but it shows as : [QUOTE]test@ [/QUOTE] how would i let it show as [QUOTE]test/r/n[/QUOTE]?

Member Avatar
0
3
Member Avatar

I made a second form but whenever i try to put it in my project i get lots of errors. I am just puting : [CODE]#include "Picture_viewer.h[/CODE] but i am getting list of errors : [QUOTE]1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5934) : error C2872: 'IDataObject' : ambiguous symbol 1> could be 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(251) : System::Windows::Forms::IDataObject IDataObject' 1> or 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll : System::Windows::Forms::IDataObject' 1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5934) : error C3699: '*' : cannot use this indirection on type 'IDataObject' 1> compiler replacing '*' with '^' to continue parsing 1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(5948) : error C2371: 'IDataObject' : redefinition; different basic types 1> C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\objidl.h(251) : …

Member Avatar
0
9
Member Avatar

hey guys, I am using windows textbox (CLR) and i was wondering how i would replace a newline to a text. I know how to replace words, i use : textBox1->Text->Replace("first","second")); but how would i replace a new line? lets say my textbox looks like this : [QUOTE] test1 test2[/QUOTE] what i want to then do is to replace the newlines with text(lets say 5), so after i replace it it should look like this : [QUOTE] test15test2[/QUOTE] i hope i explained what i want clearly, thanks in advanced.

Member Avatar
0
2
Member Avatar

I am trying to set a value in string for dateTimePicker1 but when i try the following code[CODE]dateTimePicker1->Value=System::Convert::ToDateTime("18/11/2010");[/CODE] it doesn't change anything, the old value stays thesame. How do i change the dateTimePicker to a string value?(for example : "18/11/2010") Thanks in advanced. PS: i am using c++, and a guy in the c++ forum told me to ask here, since you guys have more experiance in the .net field.

Member Avatar
0
2
Member Avatar

I am trying to set a value in string for dateTimePicker1 but when i try dateTimePicker1->Value=System::Convert::ToDateTime("18/11/2010"); it doesn't change anything, the old value stays thesame. How do i change the dateTimePicker to a string value?(for example : "18/11/2010") Thanks in advanced.

Member Avatar
0
3
Member Avatar

Hello, How do i resize/stretch the image inside a pictureBox(win32 form)? i was only managed to resize/stretch the border of the pictureBox, but i want to resize/stretch the image itself, how do i do it?. Thank you in advanced.

Member Avatar
0
10
Member Avatar

Hi all, I was following a tutorial on how to make .dll's since this is my first time making 1 but when i went to build the .dll i got an error saying : [QUOTE]definition of dllimport function not allowed[/QUOTE] my header and source is simple : Header.h : [CODE]#ifndef _DLL_TUTORIAL_H_ #define _DLL_TUTORIAL_H_ #include <iostream> #if defined DLL_EXPORT #define DECLDIR __declspec(dllexport) #else #define DECLDIR __declspec(dllimport) #endif extern "C" { DECLDIR int Add( int a, int b ); DECLDIR void Function( void ); } #endif[/CODE] Source.cpp [CODE]#include <iostream> #include "tutorial.h" #define DLL_EXPORT extern "C" { DECLDIR int Add( int a, int …

0
1
Member Avatar

Hi Daniweb users, I am attempting to make a database in c++ by saving the information to a class and then saveing it to a file. but i dont know if that is a good way to do it. Here is a example picture of the database i am making : [URL="http://img835.imageshack.us/img835/4648/databaseexample.png"]http://img835.imageshack.us/img835/4648/databaseexample.png[/URL] More details of the method i intent to use : When the user inserts the information into the textboxes the information gets saved(and also reads) in a file.txt like this : [QUOTE]{MEDatabaseid=5} { name=Carl lname=Johnsen }[/QUOTE] thats the way i intend of making a database in c++ but …

Member Avatar
0
5
Member Avatar

How do i load a text file to a windows clr textbox? and how do i save the lines of the textbox to a file?

Member Avatar
0
8
Member Avatar

How do i search all the lines in a richtextbox for a specific string in the line and then return the line number the string correspondents in. [edit]using Visual c++ windows form CLR

Member Avatar
0
5
Member Avatar

I have a custom .Ini file that looks like this : [QUOTE] [Main props] lives=3 name=danny [Mommy props] lives=2[/QUOTE] I want to know how to read from the "Main props" section and assign a new value to the "lives" key and also reading from the "name" key. I dont know how to go on about identifying the section, and changing its key. If i just change the string values then ill have a problem when i change the "Main props" lives cause it will automatically change "Mommy props" lives and thats not what i want. so i am striving to …

Member Avatar
0
9
Member Avatar

I have my class in 2 different files(header and source-file) and i have 2 variables which is a const but the only way to give the const variable a value is to do it trough an constructor initializer. But how do i implement an constructor initializer in my class ? Do i need to declare the constructor initializer or do i only need to implement it or both?

Member Avatar
0
7
Member Avatar

when you have 2 pointers pointing at the same address isn't it the-same as a reference pointer(*&)?

Member Avatar
0
2
Member Avatar

I am trying to make a list of array pointers, Is there a way that after declaring an array i can adjust the size? For example at start i create a array called : "list[2]" Is there a way that later on i can change "list[2]" and make it "list[3]" ? And is there a way i can also delete a layer of the array, so lets say there is "list[3]" is there a way to make it "list[2]" ? Or does c++ have any data types for list's?

Member Avatar
0
5
Member Avatar

Hi, I am trying to convert a char pointer to a normal char(somehow copy the strings from the pointer and pass it to the char) Here is a piece of example on what i want to do [code] #include <iostream> #include <windows.h> using namespace std; int main() { char *namen="Test"; char test[255]; test=namen; cout<<test<<endl; return 0; } [/code] If i run that code i get the following error : "invalid conversion from char** to char" I know you cant just copy a char pointer to a char but is there a way or a technique to do it? Thanks in …

Member Avatar
0
4
Member Avatar

Hey all, how do i retrieve the names(string) of all the cd drives and usb drives available? for example if my cd/usb is named "Pencil( D: )" i want the name "Pencil" to be retrieved. Thanks in advanced.

0
1
Member Avatar

Hi all, I am trying to write a string to a multiline textbox but apearently my code doesnt do as i want... This is the code i am using : [CODE]textBox9>Lines[0]="Succes";[/CODE] But when the code executes nothing happens in the textbox, everything just stays thesame :S Am i doing something wrong?, if i am pleas point me out and help me fix this error. Thanks in advanced.

Member Avatar
0
8

The End.