Hello i am using a web browser control in my program with ms visual. I use the web browsers internal functions to do things like, cut, copy, select, CreateLink....It looks like this.

this->webBrowserBody->Document->ExecCommand("CreateLink", false, nullptr);       ............

Ok, that will bring up and insert link dialog. The dialogs are blank in color. Is there anyway to access the color and background image of web browser dialog box's . thanks, cant find this anywhere.

I could add a drag event to the parents splitter and have the child splitter's Panel2MinSize set to somthing during this time. But thats alota fuss.Thanks

Hello all. I am wokring in windows forms right now. I have a form with many large split containers inside of it, in these split containers are a few more split containers. When i re-size the splitter on any of my split containers. All of the child splitters will change. I dont want this to happen, is there a way to set a ratio for a split container and how it will effect its internal compents total movement distance. in html this kind of positioning is called absolute as opposed to relative. Is there a c++ equivelant to absolute positioning?

Thanks my stucture is like this. I have a couple panels on top of some split containers. On these panels are textbox's. What i notice is that the only time it slows down is when i put textures onto the panels. Its not even the clutter it is the background textures . Is there a way to speed up redrawing of my textures when im move my form. i know what my problem is with textures when i move my form. thank you though. My programs layout couldnt get more simple. My computer is very fast too, im very frusterated with windows forms.

Hello. I am working on a windows form right now. My form is very full and i am using many textures. I have double buffered my form and made exteded classes for anything with a texture that has double buffering. Before i had double buffered everything my form was very jerky when i moved it offscreen. It would kinda stick and jerk. I notice this happens only when i move it offscreen. I have not found any information on this anywhere, im surprized im the only one who has experiences this. Another thing i have thaught of is drawing and offscreen image of my form, but i do not know how to do that . Thans all for any advice i cant continue on my project until this has been resolved thanks.

I founds somthing interesting, its from code project http://www.codeproject.com/Articles/33838/Image-Processing-using-C

It shows one how to crop. I might create somthing that will crop my image and only draw the needed portion only if the form is smaller than the total picture,thanks

Hello all. I have come to the conclusion that when i try to use images for backgrounds in my windows forms, these images have to be exactly the same size as the form or else when i move the form it will cause the form to shake. The problem with doing this is when i maximize the form the texture image i used as a background then will tile and repeat over and over to match the size of the form. What i want to do , is to use a very large and complete texture or image for background, but only load in part of it and that part it the forms width and height. Then when i resize the form to be larger, i can once again draw the image, but an increased ammount of the image from file . So ill only draw part of the image, and thats the part i need and nothing more. I have struggled for days on how this would work. please help thanks for any tips.

waw thanks alot

Hello all . I used to problems with my program shaking when i mioved it off screen. I found code thats supposed to fix it . It came from some program i was tinkering with. Its had many complex textures and all added to its form and the form didnt shake when i move it off screen. I cant seem to find any good explanations or working code for double buffering anywhere i was wondering if somone could help me with what i have found so far ont he topic.

This is the code i dont udnerstand but seems to work for a program.

protected override void OnPaint(PaintEventArgs e)

      Create an offscreen graphics object for double buffering  

         Bitmap offScreenBmp = new Bitmap(this.ClientRectangle.Width, this.ClientRectangle.Height);  

         using (System.Drawing.Graphics g = Graphics.FromImage(offScreenBmp)) {  

             g.SmoothingMode = SmoothingMode.HighQuality;  

             // Draw the control  

         //  drawControl(g);                                           

            // Draw the image to the screen 

            e.Graphics.DrawImageUnscaled(offScreenBmp, 0, 0);  
         }  

     } 

Its in c but my main project is cli, so ill rewrite it in a minute if need be. The function draw control draws an led light with the g->drawline and other draw functions. In my main form in the InitializeComponent() function at the end i wrote this too.

this->DoubleBuffered = true;

Now that first chunk of code is supposed to work with this->DoubleBuffered = true; it says in the code. I can understanding how to draw an offscreen shape but i dont understand how i would apply this to somthing like a panel instead of drawing that led. Would ...

Hello I have a large project that i bult with windows forms. When I drag a form on my screen it will move with no problem. When part of the form is overlaping the edge of my monitor and i try to drag it , the form will shutter when its moving. It moves as if it is partially stuck to its last position. I could only imagen it being somthing to do with the textures i added to the form componants properties and the way it is drawn when being dragged in this sertine way. When i remove all textures from my form it does not have the jerky drag when i move the form. Could i use another image type to solve this? thanks for any help i cant have this ruin my large project. thanks again.

Hello. I have a unique situation. I have so many text box's in my form that i wound up making a text box array. Now each text box i make i have to give it a mouse clicked event and mouse moved event. I cannot write these event functions for all of the text box's there would be too many. So i thaught i could just find out what text box has been clicked then in the events function iterate through the array of text box's and find out which one has been selected or not.

You might not have understood what im doing , but im simply looking for a textbox's selected variable. Its likely bool. I know check box's have a Checked value. It looks like this

this->checkbox1->Checked=true;

I need somthing like that but for a textbox, that will tell me weather or not it has been clikced on and highlighted. thanks all.

Hello all. I am working with threads at the moment in my program. The thread is simple and looks like this.

Thread oThread = gcnew Thread( new ThreadStart( this,&qualifiedlist::ThreadProc ) );
oThread->Start();

I have another simplar thread like this but its more complex. I try to set variables in it like this, for example.

int y;
void ThreadProc(void){

};

Thread oThread = new Thread( new ThreadStart( this,&qualifiedlist::ThreadProc ) );
oThread->Start();
cout<<y;

y will be 0!

This is veryyy simple stuff, but if i cout<<y; from outside of the ThreadProc it will be 0 always. I have tried a few other things, i dont ever remeber having this problem, i have been coding for 5 years,so am i nuts? Or should i use a delegate or something? thanks

Hello all. I have a small web server that i am using in one of my projects. It is designed to receive a message when somone click on a link containing my ip address. Its used for a email verification/ de-verification. I can run this web server and then type in my ip address into my browser, it will send my web server a message. So it works right. When i try to use it from another computer it will not work. It should, i have turned off all my firewalls, and i am not running through a router, so im hooked up directly to my external ip address. It looks like this,very simple. I couldnt figure how to use these code blocks but this is the code anyways.

#include "stdafx.h"
#include <iostream>
using namespace std;
#include <winsock2.h>
#include <string.h>
#define LISTEN_PORT 80
#define BACKLOG 5
#define PROTOCOL "HTTP/1.1"

int _tmain(int argc, _TCHAR* argv[])
{

bool t=true;
while(t){
WSAData wsadata; if(WSAStartup(MAKEWORD(2,2), &wsadata) != NO_ERROR){
cout<<"Error at WSAStartup\n";
return 0;
}
SOCKET listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if(listenSocket == INVALID_SOCKET){
cout<<"Error opening socket: "<<WSAGetLastError()<<endl;
WSACleanup();
return 0;
}
//printf(AF_INET);
struct hostent *host_entry;
char server_name[40] = "66.183.101.12";
host_entry = gethostbyname(server_name);
sockaddr_in serverService;
serverService.sin_family = AF_INET;
serverService.sin_addr.s_addr =inet_addr(server_name); //INADDR_ANY;inet_addr(server_name);
serverService.sin_port = htons(LISTEN_PORT);
//cout<< serverService.sin_addr.s_addr;
if(bind(listenSocket, (SOCKADDR*)&serverService, sizeof(serverService)) == SOCKET_ERROR){
cout<<"Error at bind: "<<WSAGetLastError()<<endl;
closesocket(listenSocket);
WSACleanup();
return 0;
}
if(listen(listenSocket, BACKLOG) == SOCKET_ERROR){
cout<<"Error at listen: "<<WSAGetLastError()<<endl;
closesocket(listenSocket);
WSACleanup();
return 0;
}
cout<<"Server connected\n\n";
while(t){
struct sockaddr_in from;
int fromLen = sizeof(from);
SOCKET msgSocket ...

Hello all. I am working with windows forms in c++/cli. I am trying to use a tabpage control. When i have a background image behind my tabs, the tabs will flicker when i click on them. I have read about using this in my forms main constructor.

[CODE]
this->DoubleBuffered = true;

this->SetStyle(ControlStyles::AllPaintingInWmPaint |

ControlStyles::UserPaint |

ControlStyles::OptimizedDoubleBuffer, true);

this->UpdateStyles();

[/CODE]
The code i wrote above does not work.
I have also read about making a new class with the tabcontrol and an extended class,then overloading its functions somehow. But i don't know, any help please this is making my whole project look bad. thanks again, for any advice.

Hello i am finishing up a pop3 program and now am looking for a way to view the html i receive form the pop3 server that comes along with some messages. People have told me to use a web browser but that seem over kill. Could i dissect a web browser and replace the ip stream with a stream from my pop messages? Thanks for any advice. Ill display code later if i find anyhting of value.

Hello all. I am working on a pop3 connection. The problem is that after i have connected , when i try to read the stream, it will work. Although the next time i read from it it will just stop my program execution and hang. Like as it its in some endless loop.

my pop3 server connection looks like this. It is missing the account information authorization, but it works and the server will send me a response . Its not about that though just the use of the ReadLine() function from StreamReader, isn't working right.

[CODE]

     tcpclient = gcnew TcpClient();     

 // HOST NAME POP SERVER and gmail uses port number 995 for POP 

    tcpclient->Connect("pop.gmail.com", 995); 

/ / This is Secure Stream // opened the connection between client and POP Server 

   sslstream = gcnew System::Net::Security::SslStream(tcpclient->GetStream(), false); 

sslstream->ReadTimeout = readTimeout;
// authenticate as client

   sslstream->AuthenticateAsClient("pop.gmail.com"); 

  reader = gcnew System::IO::StreamReader(sslstream,           System::Text::Encoding::ASCII); 

[/CODE]

I read the stream like this.

[CODE]

Console::WriteLine( reader->ReadLine());

[/CODE]

it works once.
but if i try to do it again, it will hang and i cant get past it. No matter what context that i use it in it doesn't work. Its a small thing that's screwing up days of work. Please help thanks.

Hello all. I am working with managed c++ ,cli. I am working on a large project and cannot afford to make any mistakes. In cli from what i have seen usually when i construct classes i use this ^ character to do so, like this

[CODE]

//header file
public ref class something{};

//cpp file
something ^ s;

[/CODE]

My problem is with enumerations because you make enumerations without the ref i used for the class something it looks like the fallowing.

[CODE]
//header
public: enum class C{

//cpp
C c;

}

[/CODE]
For anything else in managed c++ this would be unacceptable. Is there a ref enum class. If not will there be any problems associated with this. From what i can see this is mixing managed with un-managed, its usually not allowed, but at the moment the compiler lets it go. So whats the deal, and i good to go using it without the ref? thanks all for your eyes and time.

Hello all. I am trying to convert a c document to c++. I requires that i use the out word like this.

[CODE]

if (executeCommand("QUIT", out response))

[/CODE] is there and out for c, or a better way that i'm unaware of. Thanks all for your time. bye

Hello all. I am trying to convert a c document to c++. I requires that i use the out word like this.

[CODE]

if (executeCommand("QUIT", out response))

[/CODE] is there and out for c, or a better way that i'm unaware of. Thanks all for your time. bye

do you need to port forward without a router, because when im only hooked into my modem it says it cant see me?

Is there a difference between using

[CODE]
serverService.sin_addr.s_addr = INADDR_ANY;
[/CODE]

[CODE]
serverService.sin_addr.s_addr = "192.168.0.198";

[/CODE]
im using "192.168.0.198"; this is my external ip address, clients cannot connect from other computers. Could using INADDR_ANY instead help?

Hello all this is my c++ web server that i can get working on my computer but not connecting to others for some reason. I am not on a router, just using my external ip address. If i run the server and type my external ip address into my browser it will connect to the server properly. even with all firewalls turned off it wont work, this is my code.

[CODE]

include "stdafx.h"

#include <iostream>
using namespace std;

#include <winsock2.h>
#include <string.h>

#define LISTEN_PORT 80
#define BACKLOG 5
#define PROTOCOL "HTTP/1.1"

int _tmain(int argc, _TCHAR* argv[])
{

bool t=true;
 while(t){

       WSAData wsadata;  if(WSAStartup(MAKEWORD(2,2), &wsadata) != NO_ERROR){
       cout<<"Error at WSAStartup\n";
       return 0;
    }

    SOCKET listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if(listenSocket == INVALID_SOCKET){
        cout<<"Error opening socket: "<<WSAGetLastError()<<endl;
        WSACleanup();
        return 0;
    }

    struct hostent *host_entry; 
    char server_name[40] = "216.232.99.98"; 
    host_entry = gethostbyname(server_name);

    sockaddr_in serverService;
    serverService.sin_family = AF_INET;
    serverService.sin_addr.s_addr = inet_addr(server_name);   //INADDR_ANY;
    serverService.sin_port = htons(LISTEN_PORT);

    if(bind(listenSocket, (SOCKADDR*)&serverService, sizeof(serverService)) == SOCKET_ERROR){
        cout<<"Error at bind: "<<WSAGetLastError()<<endl;
        closesocket(listenSocket);
        WSACleanup();
        return 0;
    }    
    if(listen(listenSocket, BACKLOG) == SOCKET_ERROR){
        cout<<"Error at listen: "<<WSAGetLastError()<<endl;
    closesocket(listenSocket);
        WSACleanup();
    return 0;
    }
    cout<<"Server connected\n\n";
    while(t){

    struct sockaddr_in from;

        int fromLen = sizeof(from);
    SOCKET msgSocket = accept(listenSocket, (struct sockaddr*)&from, &fromLen);
        if(msgSocket == INVALID_SOCKET){
            cout<<"Error at accept: "<<WSAGetLastError()<<endl;
            closesocket(listenSocket);
            WSACleanup();
            return 0;
        }

        cout<<"Clinet: address "<<inet_ntoa(from.sin_addr)<<" port: "<<ntohs(from.sin_port)<<endl;

        char HTML[] = "<HTML><TITLE></TITLE><BODY><H1>SENT From me!</H1></BODY></HTML>";
        char sendBuff[40];
        char recvBuff[40];
        int bytesSent = 0;
        int bytesRecv = 0;

        //recieve from client
        bytesRecv = recv(msgSocket, recvBuff, (int)strlen(recvBuff), 0);
            cout<<"\n"; cout<<"\n"; cout<<"\n";
        printf("\nRecieved data = %s ", recvBuff); 
            cout<<"\n"; cout<<"\n"; ...

I can never get port forwarding working no matter what i do, for some reason . so im not using my router anymore, just the external ip hooked up to my comp and in my server. When i run it, i can connect to my external ip address from my browser but not from another computer at another location,even with all firewalls turned off. What else could be wrong eveyrone tells me im doing the right thing, but it still wont work.

Hello all i am working on a web server right now. I can normally type in my ip address at my house and it will connect to my server if my firewall is shut off. I have a router, with and internal and external ip. I'm trying to get my server connecting to the outside world. when i go to my library and type in my internal ip address it actually connects, which was a surprise, but at least it seems to be working. When i try to use my external ip address, it will not connect.My firewalls will be all closed when im doing this. What could be the problem i have to figure this out .

thanks all people.

Hello. All i am having trouble with using public ref classes and gcnew. The following code will show you my situation.

Vector2 class

/// </summary>
public ref class vector2{

public:
    vector2(void):x(""),y(""){};
System::String ^x;
System::String ^y;
void Position(System::String ^ X, System::String^ Y){

x=X;
y=Y;

};

};

Add picture class

public ref class AddPicture {

public:

    AddPicture(void):fileName(""){}
    vector2 ^ V1,^ V2;

    System::String ^ fileName;
    void newAddPicture(vector2 ^ v1,vector2 ^ v2,System::String ^ filename){

    fileName = filename;

    V1=v1;
    V2=v2;

    }

then this is where construct these

    this->newAp = gcnew AddPicture();

    vector2 ^vv1,^vv2;
    vv1= gcnew vector2();
    vv2= gcnew vector2();
    vv1->Position(posx,posy);
    vv2->Position(sizex,sizey);

    newAp->newAddPicture(vv1,vv2,MyString1);

if i want to access newAp->V1->x; or y an error shows up that says null reference exception unhandled. I cant figure it out, i dont know how to use ref class's can anyone tell me how to access these kinda of classes like im trying to above.thanks

im using the internal ip for setting up port forwarding, and no i cant access my port from computers in my network, i tryed to use a chat prorgam in c++ and my computer wont recognise my internal ip address, but on the other computer it does fine. Could it have anyhting to do with wireless

Hello all . I have a few simple one or two questions. I'm wondering what the limitations of a web server are. say i have xamp with apache in it running hooked up the the folder i usually put my web, sites on, can i type in my ip address in a browser, and go view that folder or its contents on another computer?

I would assume if its possible it might look like this [url]http://ip:port[/url]. Is that correct format?

Is it possible to view a web site that has no domain name assigned to it? I'm asking this for many different reasons and different projects.

thanks all.

Hello all. I have been trying to get port forwarding going for 3 days with my d link DIR-628 router. Ive been checking to see if my changes to my dlink settings have taken effect at this web site and many similar. [url]http://www.canyouseeme.org/[/url] . I usually type in my local ip number into my browser. that takes me to the dlink login page. then i go to advanced -> port forwarding, and i add in my local ip address and specify the port numbers for tcp and udp. I save the settings and restart. Then i go check and no matter what i do the ports will not open!! i cant stand it. I close all firewalls too. Is there something i should know about this that was in the dlink fine print. Please help before i go mad.

Hello all. I have made a web server in c++; I am able to type in my browser [url]http://localhost[/url] , this will contact my server and make a connection i can add a variable onto the end separated with a ?. I want to send messages to my web server it this way. this is going as planned and working well. The next step that has drove me made for 3 days, is why cant i type in my ip address into my browser and have it do the same thing. In my mind this is how chat servers and clients works and it could work, im just missing a step. please help before i pop! thanks

Hello all, i working on a server I have realized that it only is using the loop back address of my ip. It looks like this.

[CODE]

struct sockaddr_in from;

        int fromLen = sizeof(from);
    SOCKET msgSocket = accept(listenSocket, (struct sockaddr*)&from, &fromLen);
        if(msgSocket == INVALID_SOCKET){
            cout<<"Error at accept: "<<WSAGetLastError()<<endl;
            closesocket(listenSocket);
            WSACleanup();
            return 0;

[/CODE]
I didn't post all the code because its unnecessary. The loop back address 127.0.0.1 is in from.sin_addr . I do not want to use this i want to use the external address. Is there an external address within the struct sockaddr_in somewhere. The accept function i really want to keep using requires an address from the struct type sockaddr_in, so i hope it has the external address. Thank for any advice.