|
Listbox Notification works only if a list item has been
clicked or double-clicked...
Or show me exactly what you mean...!?!
Manfred
---
Programming is knowing...
|
|
|
|
|
hmmmmmm
i been messing about for a few hours and it seems you're right ... duhhh ... well at least i can't get it to notify me either ... sheesh ... i wonder if mfc doesn't let that message get 'out of the box' so to speak
sorry
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I got the same problem too.
I try to resolve it by disable the scroll bar in CListBox,and insert a CScrollBar to control all CListBoxes.
But, very weird is that I can not see any usable message for scrollbar in ClassWizard!?
Does anybody know why? How could I control a Scroll bar? I really need help!
|
|
|
|
|
We have win95 exe's written in c++ & mfc...these work well on win95, but keep blowing up with "Abnormal Terminations" on win2000.
How best can I migrate my VC5 & MFC code to Win2000 ?????
Would a win2000 dev pc with devStudio install & a recompile do any good?
Cheers
Gerry.
|
|
|
|
|
I'm not expert in these things, but let me share my experience.
From my personal experience, you need to work it(compile ... devet.. testing) on a nt or 2k machine. The problem is most of the code would work without a hickup in 95/98 but almost always will end up blowin up in NT / 2K. Most of the problem could be to do with uninitialized memory (in my case that was the problem) so while do the debugging in NT/2K machine ... you have more chances of spotting the bug.
Cheers
Kannan
|
|
|
|
|
moral of the story is always init your ptrs to NULL in your constructors and test for NULL before using them kidz
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Generally speaking, there's probably a bug in your code that isn't showing itself in Win95. This might be because you're relying on the way Win95 returns or processes data, which is different under NT. Or it might simply be because NT and Win95 create different kinds of call stacks and therefore exposes a bug that just happened to work under 9x.
In any case, you should debug on the platform you're trying to target.
|
|
|
|
|
Hi,
Is there a way to get the original URL of a file stored under the "Temporary Internet Files" folder (I am looking for the value of the column "Internet Address", as displayed in Windows Explorer).
Thanks,
J.
|
|
|
|
|
Dear all,
I'm writting a MFC program that enables the user to enter the URL, and then
press "Start" button to start downloading the html from that URL. So I have
create a WorkerThread to handle the downloading process so that the user can
press "Stop" button to terminate the downloading process.
After successful or unsuccessful downloading of html, it should call a
Text-to-speech function to speak to the user about the status of download.
However, the text-to-speech function cannot work when there is another
thread running.
I have tried to create another thread to call the TTS function, but it
failed too.
My question is :where does the thread return when it finished??
Is there anyother method to call my TTS() function when the thread is
finished?
Here is my program:
// myappdlg.cpp
static UINT workerthreadcontrol ( void * pRTclass )
void myappdlg.OnStart()
{
downloadHTML();
}
void downloadHTML()
{
.....
CWinThread* pWorkerThread;
pWorkerThread = AfxBeginThread ( workerthreadcontrol, this,
THREAD_PRIORITY_NORMAL, 0,
CREATE_SUSPENDED );
m_Startbtn.EnableWindow( False );
m_Stopbtn.EnableWindow( True );
pWorkerThread->ResumeThread();
.....
}
UINT workerthreadcontrol( void * pRTclass )
{
myappdlg pDlg = (myappdlg*) pRTclass;
pDlg->WorkerThreadProcess();
return 0;
}
void WorkerThreadProcess()
{
doing downloading.........
}
// Where should I put this function???
void TTS( LPCTSTR Text )
{
Speak out Text.....
}
Thanks a lot for your help....
Best Regards,
Vickie
|
|
|
|
|
If I understand, your problem is you need to know exactly when the worker thread has quit? Right before the return in the thread function, post a message (WM_APP would do) to your dialog to tell the UI thread that the worker thread is done.
--Mike--
http://home.inreach.com/mdunn/
The preferred snack of 4 out of 5 Lounge readers.
|
|
|
|
|
Hi everybody:
How could I convert a CHAR dimension into a BSTR???
I have:
BSTR *alt;
CHAR Msg[200];
Thanks in advance:
Javier
|
|
|
|
|
You could use wcscpy or BString, CString...I think.....
Gerry.
|
|
|
|
|
To finish up your example:
_bstr_t *alt; //this is changed a bit
char Msg[200];
strcpy(Msg, (char*)(*alt)); //to go from _bstr_t to char[]
alt = new _bstr_t(Msg); //to go from char[] to _bstr_t
_bstr_t wraps up the BSTR data type
|
|
|
|
|
THANK YOU BERY MUCH Sir!!!
Now I have a _bstr_t value, but I need to have a BSTR, so HOW COULD I CHANGE FROM _bstr_t pointer to BSTR pointer.
I have the
_bstr_t *alt;
BSTR *restxt;
HOW COULD I PUT THE VALUE OF _bstr_t in restxt??????
Thanks and BEST REGARDS!!!!
Javier.
|
|
|
|
|
search in MSDN for USES_CONVERSION A2OLE.
Good luck,
Dror
|
|
|
|
|
See MSDN library for this function:
BSTR SysAllocStringByteLen(
LPCSTR psz,
unsigned int len
);
|
|
|
|
|
I've been trying to solve the Josephus Problem using the Linked List approuch. I was able to get the last person to be alive.. and to delete the 1st person.. BUT.. I want to be able to delete Every one in the link EXCEPT the last one.. Any ideas how to do that ?! Thank you... here's my Code so far...
// OQ8
//oq8@gmx.net
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
#define MAX 20
typedef int node_type;
struct node_rec
{
node_type num;
node_rec *next;
};
typedef node_rec *node_ptr;
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
void insert(node_ptr temp, node_ptr &headptr)
{
node_ptr curr;
node_ptr prev;
if (headptr == NULL)
{
headptr = temp;
return;
}
if (temp -> num < headptr -> num)
{
temp -> next = headptr;
headptr = temp;
return;
}
prev = headptr;
curr = headptr;
while ((curr != NULL) && (curr -> num < temp -> num))
{
prev = curr;
curr = curr -> next;
} // while
prev -> next = temp;
temp -> next = curr;
} // insert
////////////////////////////////////////////////////////////////////
int delete_node(node_type temp_num, node_ptr &headptr)
{
node_ptr curr;
node_ptr prev;
prev = headptr;
curr = headptr;
while ((curr != NULL) && (curr -> num != temp_num))
{
prev = curr;
curr = curr -> next;
} // while
if (curr == NULL)
{
// cout << "Number not in list" << endl;
return 1;
}
if (curr == headptr) headptr = curr -> next;
else prev -> next = curr -> next;
delete(curr);
return 0;
} // delete_node
////////////////////////////////////////////////////////////////////
void print_list(node_ptr headptr)
{
node_ptr temp;
cout << " LIST OF NUMBERS : ";
temp = headptr;
while (temp != NULL)
{
cout << " " << temp -> num;
temp = temp -> next;
}
cout << endl;
} // print_list
int last(int n, int k)
{
int person[MAX]; /* 1 means person is alive, 0 means dead */
int i; /* person who has punch */
int count; /* number of times punch passed to alive person */
int q;
for (i = 0; i < n; i++) person = 1; /* everyone starts alive */
i = 0; /* assume punch starts at person 0 */
person = 0; /* person with punch dies */
for (q = 1; q < n; q++)
{
count = 0;
while (count < k) /* pass punch k times */
{
i = (i + 1) % n; /* pass punch */
if (person)
count ++; /* increment if alive person in circle */
}
person = 0; /* person with punch dies */
} /* person i was last to die */
return i;
}
// main function //
////////////////////////////////////////////////////////////////////
int main()
{
int N, K, T, M, L, count, dl;
node_ptr headptr;
node_type Pos;
node_ptr temp;
headptr = NULL;
N=99;
K=T=M=L=0;
cout<<"How many people (N)? ";cin>>N;
if (N == 0) return 0;
cout<<" Passing count (K)? ";cin>>K;
cout<<" the Last person to be alive (T)? ";cin>>T;
for (int v=1;v<=N;v++)
{
temp = new(node_rec);
temp -> num = v;
temp -> next = NULL;
insert(temp, headptr);
} // a linked list has been created up to (1 to N)
print_list(headptr);
L=last(N,K);
M = (T-1 - L + N) % N + 1; /* rotate solution so person t is last to die */
count=N;
Pos=M;
dl=0;
for(int X=0;X<n;x++)
{
cout<<" now="" delete="" person="" ["<<pos<<"]"<<endl;
delete_node(pos,="" headptr);
print_list(headptr);
pos+="K;
if" (pos="">N) Pos= Pos % N;
}// I want to delete everyone BUT #T.. ?? Help please...
return 0;
} // main
//---------End Of Josephus-----------
now.. how cal i goto the head of the link ! and not to count the deleted numbers ?
here's some numbers to test...
N K T
15 11 7
12 7 1
5 1 2
5 3 4
|
|
|
|
|
Hey guys, Check this out,, this is a function that converts a int to a string, it compiles and works fine with VC++.. problem is i need it to compoile on Sun, HP and DEC. I get a compile error <sstream> not found, so i tried using the <strstream> header, when i do that it dosent recognize what std::ostringstream is.. Im totally lost when it comes to unix compilers,, can anyone help me convert this code so unix g++ will understand it and compile it. Pleaseeeee
#include<sstream>
std::string itos(int arg)
{
std::ostringstream buffer;
buffer << arg; return buffer.str();
}
Thank You!
say what?
|
|
|
|
|
hummmm. i guess this dicussion board dosent like the angle brackets, seems whatever is inside them dosent show up on the screen,, anyway i will rewrite this post.
Hey guys, Check this out,, this is a function that converts a int to a string, it compiles and works fine with VC++.. problem is i need it to compile on Sun, HP and DEC. I get a compile error sstream not found, so i tried using the strstream header, when i do that it dosent recognize what std::ostringstream is.. Im totally lost when it comes to unix compilers,, can anyone help me convert this code so unix g++ will understand it and compile it. Pleaseeeee
#include<sstream> //sstream
std::string itos(int arg)
{
std::ostringstream buffer;
buffer << arg;
return buffer.str();
}
Thank You!
say what?
|
|
|
|
|
Not all compilers support have the standard library, and not all of them can support it (especially older compilers).
You need to make sure you're using the most recent compilers from your vendors and if they don't include a standard library, you may need to acquire one.
|
|
|
|
|
Hi
How can I get a type library name (without registring the type library in system registry) after loading this library by
LoadTypeLibEx(szFileName.Copy(), REGKIND_NONE, &hTypeLib);
Thanx
|
|
|
|
|
Hi
How can I get a type library name (without registring the type library in system registry) after loading this library by
LoadTypeLibEx(szFileName.Copy(), REGKIND_NONE, &hTypeLib);
Thanx
|
|
|
|
|
Now I write the program that move the transparent bitmap (sprite) across the screen with MFC (Use BitBlt function) but the problem is when I run program for a while (20 min) the sprite that is moving is disappear from the screen but the program is still running. Do you know what's happen and how can I reslove it?
Thank you
Kyousuke
|
|
|
|
|
are the co-ordinates taking it out of the clipping region?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
No, because I wrote the function that control the sprite to move on the circle line(The train is running on rail). And the sprite move around it several round until from 5:00AM-3:00PM->Simulate time(1 hour Simulate time = 2 min in real world) and after that it disappear.
|
|
|
|