|
When I use the Data Grid control and ADO in my program, It run correctly,but it can't run on the machine whithout the Vc++ IDE correctly. It troubles me for all day. Can somebody help me !
Thanks very much!!
splendoury
VCBeginer
|
|
|
|
|
You have to register ocx file of DataGrid in that machine.For this purpose you can use installshield and add that file to it.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Is it to copy the file named DBGRID32.OCX to the system directory! I do like this, but it's unuseful. Is it ADO that cause it!!
VCBeginer
|
|
|
|
|
Forlegend wrote:
DBGRID32.OCX
no,thats msdatagrid.ocx. If you don't use installshield,use regsvr32 in command menu for that file,then run your application.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Thank you very much!!
VCBeginer
|
|
|
|
|
Hi all,
how to create a main application and with a menu command open inside this main applicationa one or more dialog (but not called with a DoModal())?!
Thanks!
|
|
|
|
|
Why is DoModal() so scary to ya!?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
If you want to avoid modal dialogs create a modeless dialog
Nish
I am the Keyboard Smasher
|
|
|
|
|
do you want to use Create() and ShowWindow() instead to show the dialog?
|
|
|
|
|
Hi,
In my program, I've used multithread (many clients) to send message to one thread(Server). However, I realized that only the first client can get access to the server from start to end, other clients are blocked. Can anyone help me to solve this problem??
The following is the code of the server:
if ( svrSocket.Accept(socket))
AfxMessageBox("Socket is created Succesfully");
while (...)
flag = socket.Receive(buff,sizeof(buff));
....
Please HELP! Thank you!!
|
|
|
|
|
while( ...)
{
if ( svrSocket.Accept(socket))
{
CSockThread sockThread = new CSockThread(sock);
// class CSockThread : CWinThread
}
}
Receive in Thread
while (...)
flag = socket.Receive(buff,sizeof(buff));
....
|
|
|
|
|
hi ,
I use an array to store all thread ID:
CWinThread* thread[10];
thread[i] = AfxBeginThread(.....)
then, in the thread function, I will use pThread = AfxGetThread(); in order to get the thread ID of that thread. (CWinThread* pThread)
In another function, i will use: (e.g.)
if (pThread == thread[i])
.....
Is it workable????
|
|
|
|
|
Try this:
if(AfxGetThread()->m_nThreadID == thread[i])
{
//Do something
}
instead of:
if(pThread == thread[i])
{
//Do something
}
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
thread[i] is not an ID, but address of CWinThread-derived objects. You can use it to identify the thread assuming that you're using AfxBeginThread for thread creation.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Hi,
I am working on eVC++ and I want to place a bitmap on a atatic control.
I am using the following code. It compiles but I am not able to see the bitmap on the screen.
Any pointers ??
MyBmp.LoadBitmap(IDB_BITMAP1);
myStatic.SetBitmap(MyBmp);
An expert is one who has made all the mistakes.
|
|
|
|
|
When you create your static control, add SS_BITMAP to the dwStyle parameter.
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
How to retrieve a RGB value of Bitmap directly in memory without use GetPixel of the CDC with logical coordinate of the point to be examined?
thx
|
|
|
|
|
You can do that only if you have so-called DIBSection. DIBSection is a bitmap that application can read and write to directly.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
First you will have to get a pointer to the buffer with a DIB section.
Then you can use LPtoDP to convert the logical coordinate to the device coordinate in the bitmap.
|
|
|
|
|
see GetDIBits, if you want to do it yourself. or, look for one of the many DIB wrapper classes available on this site.
(or try http://www.smalleranimals.com/isource.htm)
-c
Smaller Animals Software, Inc.
Few things are harder to put up with than the annoyance of a good example.
Mark Twain
|
|
|
|
|
hello everybody
forgive my poor english, it's not my native language.
i have vc++6.0 and i have installed it on win XP home edition.
All seems to work fine, but i wonder:
-which are the 'limitations' or 'pitfalls' of applications developed in this platform? I mean: can they run fine also in win95/98/ME?
-is there a list of functions etc. to not use and that we have to know in order to avoid any 'compatibility trouble'?
any suggestion will be greatly appreciated
thanks in advance
Joe
|
|
|
|
|
Joe IT wrote:
I mean: can they run fine also in win95/98/ME?
Of course.
Joe IT wrote:
is there a list of functions etc. to not use and that we have to know in order to avoid any 'compatibility trouble'?
The reverse is true - you can't write W98/ME/2000/XP specific code without installing the platform SDK. Try TransparentBlt - the compiler won't know what it is ( it's been there since W98 ). You need a PSDK to provide the lib and header files for the compiler to call these functions, even though they are present in the OS.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
hello Christian
thank you for your reply
so, just to summarize, if i work with vc++6.0 / win XP (as i like to do) i can be sure that my MFC applications will run properly also in the previous platforms. this is my concern
>The reverse is true - you can't write W98/ME/2000/XP >specific code without installing the platform SDK
do you mean of course the case of working inside win xp?
by the way, are the platform SDKs downloadable from msn?
sorry but my knowledge of the vc++6.0 is little and related to MFC only
thanks again
Joe IT
|
|
|
|
|
Hi,
I've found this equation in here:
#define Randomize(min, max) ((rand() % (int)(((max) + 1) - (min))) + (min)) //get a random number between min and max
and I realized that the result generated are the same each time, so I've added this before calling the above equation:
srand((UINT)time(NULL));
But then, when I use multithread, (e.g. 2 threads), they call the Randomize function and the one above, and generate the exact same result.
So, my question is:
How can I get two different results when 2 threads are created at the same time??
(By the way, I've also tried Sleep(Randomize(....)) to let them start at different time...)
PLEASE HELP!!! THANKS!!!
|
|
|
|
|
Try with srand(((unsigned)time(NULL))^GetCurrentThreadId()) .
PS: I substituted ^ for | . XOR is better suited for this purpose.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|