|
I use Sleep() all the time in threaded code, there's no reason it should cause the termination in and of itself.
However, the thread code you show runs in the context of a larger program, notably the main thread which created the thread you show. What is that thread doing? If it exits, it will take the created thread down with it.
Make sure the main code is waiting for this thread to terminate before it does.
|
|
|
|
|
VVVimal wrote: When tried to give break point over here appliacation gets terminates
do you mean, it is getting terminated when you try to debug?
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
I just added
WatiForSingleObject(threadHandle,INFINITE)
now working fine. Can any one tell why does it so
|
|
|
|
|
My answer above told you exactly why WaitForSingleObject() solved the problem
However, the thread code you show runs in the context of a larger program, notably the main thread which created the thread you show. What is that thread doing? If it exits, it will take the created thread down with it.
|
|
|
|
|
Hi All
How can i read *.xlsx format?I am able to read *.xls format.Plz help me to read *.xlsx format.
|
|
|
|
|
MsmVc wrote: How can i read *.xlsx format?
Isn't it just an XML-type file? Regardless, just use Excel Automation and let Excel handle the details for you.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
thanks for reply but it is pure *.xlsx file and can i read *.xlsx file as a XML.
Plz help me
|
|
|
|
|
|
Hi,
I want to learn ATL. and I dont know any thing about ATL programming. Please send URLs for downloding any free PDF's, and please sujjest me the approach for learnig ATL.
Thnaks In Advance.
sampath-padamatinti
|
|
|
|
|
sampath-padamatinti wrote: I want to learn ATL
It is a demanding aim expecially when you miss the right forum [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
sampath-padamatinti wrote: please sujjest me the approach for learnig ATL.
A wise approach would be to locate the beginner level articles on ATL here at CP and start reading those.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I want to set background color of menu and submenu in dialog based application in vc++,mfc
|
|
|
|
|
|
How to display context menu on rightbutton click of mouse in richedit textbox control in vc++.In my application it will display context menu on dialog box on rightbutton click of mouse.but i want to show it on richedit tcontrol textbox in vc++,mfc
|
|
|
|
|
I assume that you mean you want to display your application's context menu. In which case you need to subclass the richedit control and capture the right click message in the window's message handler.
|
|
|
|
|
Hello all,
i have a WSDL of .net based web service.
i need to call methods from that webservice using soap. i made all the supporting files and trying to call methods as follows:
struct soap soap;
soap_init(&soap);
ns1__loginVisitor.name = (char *)calloc(1, strlen("Test") + 1);
strcpy(ns1__loginVisitor.name ,"Test");
ns1__loginVisitor.pwd = (char *)calloc(1, strlen("12345") + 1);
strcpy(ns1__loginVisitor.pwd ,"12345");
ns1__loginVisitor.memorizeLogin = xsd__boolean__false_;
stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];
ns1__loginVisitor.moduleType = (char *)calloc(1, strlen("Contact Directory") + 1);
strcpy(ns1__loginVisitor.moduleType , "Contact Directory");
struct _ns1__loginVisitorResponse ns1__loginVisitorResponse;
struct _ns1__getCountriesResponse ns1__getCountriesResponse;
&ns1__getAccountInfoResponse);
soap_call___ns2__getCountries(&soap, NULL,NULL,NULL,&ns1__getCountriesResponse);
if(soap_call___ns2__loginVisitor(&soap, NULL,NULL, &ns1__loginVisitor, &ns1__loginVisitorResponse) == SOAP_OK)
{
NSInteger yu = 90;
}
but i am not getting proper response from the webservice.
can any body tell me where i am wrong? or please suggest me.
|
|
|
|
|
I have been trying to figure out what is wrong with this code. its probably something really obvious just that isn't clear to me. I would like any help that can be given, thanks.
int main(int argc,char* argv[])
{
Animals *ourAnimals[6];
Animals *goldfish = new Goldfish();
Animals *crocodile = new Crocodiles();
Animals *elephant = new Elephants();
Animals *gazelles = new Gazelles();
Animals *shark = new Sharks();
Animals *snakes = new Snakes();
ourAnimals[0]=goldfish;
ourAnimals[1]=crocodile;
ourAnimals[2]=elephant;
ourAnimals[3]=gazelles;
ourAnimals[4]=shark;
ourAnimals[5]=snakes;
string name, gender, weight;
name = "the Goldfish";
gender = "Female";
weight = "One Ounce";
goldfish -> setName(name);
goldfish -> setGender(gender);
goldfish -> setWeight(weight);
}
and this is the class
#pragma once
#include <iostream>
#include <string>
using namespace std;
class Animals
{
public:
Animals(void);
virtual ~Animals(void);
string getName() {return m_name;}
string setName(string &name){return m_name = name;}
string getGender(){return m_gender;}
string setGender(string &gender){return m_gender = gender;}
string getWeight(){return m_weight;}
string setWeight(string &weight){return m_weight = weight;}
virtual void goOut() = 0;
virtual void converse() = 0;
virtual void getBack() = 0;
protected:
string m_name;
string m_gender;
string m_weight;
};
it gives me an unhandled exception error.
this is my goldfish class
#pragma once
#include "marine.h"
class Goldfish :
public Marine
{
public:
Goldfish(void);
virtual ~Goldfish(void);
virtual void converse();
};
Goldfish::Goldfish(void)
{
}
Goldfish::~Goldfish(void)
{
}
void Goldfish::converse()
{
cout<<"The Gold fish speak: "<<"Bloob Bloob"<<endl<<endl;
}
there is another derived class from Animal which is Called Marine in this case which looks like this
#pragma once
#include "animals.h"
class Marine :
public Animals
{
public:
Marine(void);
virtual ~Marine(void);
virtual void goOut();
virtual void converse()= 0;
virtual void getBack();
};
#include "Marine.h"
Marine::Marine(void)
{
}
Marine::~Marine(void)
{
}
void Marine::goOut()
{
cout<<"The Marine animals: "<<"swim out and are fed"<<endl<<endl;
}
void Marine::getBack()
{
cout<<"The Marine animals: "<<"Swim in"<<endl<<endl;
}
another thing to add is that if I move around the order of the protected variables. The error is always on the thrid variable
protected:
string m_weight;
string m_name;
string m_gender;
modified on Tuesday, September 22, 2009 9:23 AM
|
|
|
|
|
Hi,
You don't need to return anything from your setters. Make them void like this:
void setName(const string& name){m_name = name;}
void setGender(const string& gender){m_gender = gender;}
void setWeight(const string& weight){m_weight = weight;}
Try this and if you still get error messages, please post the exact message here.
Nuri Ismail
|
|
|
|
|
this doesn't help, I get
Unhandled exception at 0x1026edac (msvcr90d.dll) in Zoo.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd
|
|
|
|
|
Sivyo wrote: Unhandled exception at 0x1026edac (msvcr90d.dll) in Zoo.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd
Most likely, you are either accessing a memory location that is not been allocated or has been freed already.
I've tried the code from your modified post and it works fine.
Maybe you should go step by step through your main method and track your heap objects.
You should also use the call stack window in order to see the exact position of the crash in your code.
Nuri Ismail
|
|
|
|
|
I don't actually know how to use the call stack window. I will google it see if that will help.
I did debug it and create break points and it always crashes right after set weight.
I checked out the watch. and everything goes where it is supossed to but then it just crashes right after everything is set.
I commented out set weight and it seems that is the problem, it doesn't crash if I take it out
|
|
|
|
|
Sivyo wrote: I commented out set weight and it seems that is the problem, it doesn't crash if I take it out
Don't be so sure. You may have just moved the problem to another, less-sensitive location.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
well, apparently something was wrong with that computer. I was working with it at school and now that I am home, the program works fine.
Makes me feel really stupid.... worked 4 hours on that thing and the problem was with the computer. i didn't get anything done....
|
|
|
|
|
Post ere more info about the unhandled exception (the debugger helps a lot, see for instance the call stack window).
BTW you didn't post the Goldfish class code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
the debuggers shows me this window and shows me where it stops...
LeadUp1:
and edx,ecx ;U - trailing byte count
mov al,[esi] ;V - get first byte from source
it stops here
-> mov [edi],al ;U - write second byte to destination
mov al,[esi+1] ;V - get second byte from source
mov [edi+1],al ;U - write second byte to destination
mov al,[esi+2] ;V - get third byte from source
it compiles it fine, but once it executes it I get the
Unhandled exception at 0x1026edac (msvcr90d.dll) in Zoo.exe: 0xC0000005: Access violation writing location 0xcdcdcdcd
|
|
|
|