|
How can i change width and height of a Bitmap and save it again?
|
|
|
|
|
Iam Developing Client/Server Application in MFC Using CSockets.I created Server Socket(Serrived From CSocket) and Created One Thread To Listen to the incoming Requests.In Side that thread iam calling Accept()of CSocket.But my Application is Crashing.can you pls help mw regarding this
VamsiDhar.MBC
SoftwareEngineer
|
|
|
|
|
There are some questions:
1. when your app. crashes?
2. where your application crashes?
3. Which App crashes?(client or server)
You must trace what happening in debug mode in both sides.
|
|
|
|
|
here is my Answers to your question..
My Server Application is crashing when the Application Calls the Thread To start server.
Inside the Thread i called the Accept() methodof server Socket.Then it is Crashing.(It is Crashing becoz it is getting AfxGetInstanceHandle() as NULL).May be the way iam Calling the thread is wrong .
VamsiDhar.MBC
SoftwareEngineer
|
|
|
|
|
normally when i wanted a struct array i would do something like this
typedef struct _TEST
{
char szString[64];
int number;
} TEST;
TEST *t = (TEST*)malloc(sizeof(TEST) * 10));
in which case i would end up with 10 elements in the struct array
but say later, for example when a user adds an item to a list, i need to add another element, is there is there a way to easily do this ?
|
|
|
|
|
|
thank you this is exactly what i needed,
|
|
|
|
|
See my comment about realloc() here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
The easiest way is to use std::vector .
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
vectors are C++ specifics, and so don't exist in the C language (but i agree, the owner of the thrad didn't precise told us that detail)...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Yes it is. However, you need a totally new approach for this. Use a linked list. make a struct for the node like so:
struct node
{
<any datatype=""> variable;
.
.
.
struct node *Link;
};
now make a struct for the linked list like so
struct list
{
node *First //first node in the list.
void InsertNode(node *temp) //inserting at end of list, or anywhwere u like
};
the first node will point to the next node, it will intern point to the next and so on. u can now use malloc to dynamically allocate mem for each node and append them at the end of the chain. remember to always keep the Link of teh last node in the chain as NULL. this is the end of the list. Please see more info on linked lists. There is too much out there for me to explain here, but this is the general format of a SINGLY LINKED LIST, but there many types.
hope this has helped. you can change the functions in the list struct as per your requirements. you may add function for deleting, etc. You cannot create a dynamica array and maintain the data in it at the same time, unless you are using vb, where you can actually do this by ReDim.
I hope i have answered your question )
|
|
|
|
|
actually it seems to work just fine the way i was doing it, and no offense, but i would like a second opinion, before doing this the way you have suggested
|
|
|
|
|
Archer282 wrote:
but i would like a second opinion, before doing this the way you have suggested
Archer, I had this very same question. With the help of a couple of others I started using std::vector. It works very well.
Here is the thread I started Data Storage[^]
Here is an article explaining Vectors[^]
Hope this helps, Good Luck...
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
Now I must call IDL's routine using VC. Those routines are in sav file, and I don't have source codes of sav file. How can I do this? Thanks.
|
|
|
|
|
I have simple class
template< class TProblemType >
class CFemInput
{
public:
CFemInput(CFemInputAdapter::eAdapterType eType, const TCHAR* szFileName);
virtual ~CFemInput(void);
private:
// proxy class
CFemInputAdapter* m_pAdapter;
};
template< class TProblemType >
CFemInput< TProblemType >::CFemInput(CFemInputAdapter::eAdapterType eType,
const TCHAR* szFileName)
: m_pAdapter(NULL)
{
switch(eType)
{
default:
case eFile:
m_pAdapter = new TProblemType(szFileName);
break;
}
}
template< class TProblemType >
CFemInput< TProblemType >::~CFemInput(void)
{
}
For some unknown reasons I getting link error if I split this code in h and cpp file. If everything in one h file everything is fine. Why linker can't find constructor or destructor if they in sepparate files. First time have such problem. I have VS2003 under debug (no optimisations)
Thanks.
|
|
|
|
|
|
Thanks man. I aways thought that in VS6 I was able to sepparate it.
My bad.
|
|
|
|
|
I have sometimes separated them using an .inl file.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|
|
But the INL file still is compiled into each of the CPP files needing the template function definitions.
Saying that the functions must be implemented in the H file is just the easy and quick answer to a more complicated issue. To be more correct, a template function/method implementation must be in the same compliation module as where it is referenced. (I don't know exactly what the standard says.)
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Dear Friends,
Trying to make a dialog based application. I am trying to use CDialog::OnTimer() and set the timer before this. But function having CDialog::OnTimer() is never called by the application .....
Can anyone help me wat cud be the possible reason.....
Thanking u in anticipation.....
mukhan
NOte:- MSVC++ 6.0
OS: WinXP
|
|
|
|
|
I assume you've called SetTimer() , presumably in OnInitDialog() . You also need to add a ON_WM_TIMER() entry in your dialog's message map, eg:
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
ON_WM_TIMER()
...
END_MESSAGE_MAP() My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib@ravib.com
|
|
|
|
|
Thx Ravi Bhavnani,
its working now
mukhan
|
|
|
|
|
Result of SetTimer(...) was equal to what? Do you check result? Message map is OK
has entry for timer?
|
|
|
|
|
|
I'm writing a VC++ .NET application in which I need to present the user with data on an on going basis. The user always needs to see the most most recent data.
I'm dumping the data to a RichTextBox. The only problem is that the richtext box keeps scrolling up to the top of the box, showing the use the first data entered.
Is there a property of the richtextbox that can be changed to show the last data entered? Or is there a custom control that could do this?
Thanks.
|
|
|
|