|
Hi,
I am having a problem with updateResource API with strings.
I want to delete all the strings in a string Table and rewrite them in another language.
This creates 2 sting tables
1. the new destination string table with the new strings.
2. the older string table (All the strings are however deleted here)
on selecting the older sting table in the resource editor(VC.NET), the editor throws an error and shut down throws
I want to get rid of the older String table
PS NOTE: the application works properly in some computers but in some computers, the above mentioned problem occurs...
Could i know the reason for the same, and the process of getting rid of this problem..
thanks in advance..
Vinod
|
|
|
|
|
Hi,
I need to generate a lot of Excel files. I don't want to use Excel Automation (Excel version dependant, perf, etc. ). So, I'm looking for a good C++ library to create spreadsheets dynamically...
No C#, No .net. ActiveX would be ok. (actually, I'm using STL/ATL)
Nota:
CSV files do not match my requirements cause I have to customize cells, borders, colors and so on...
Can you help me ?
|
|
|
|
|
You distant past may still haunt you...
magicbassfr wrote: I need to generate a lot of Excel files. I don't want to use Excel Automation (Excel version dependant, perf, etc. ). So, I'm looking for a good C++ library to create spreadsheets dynamically...
I know you posted this quite some tome ago... therefore I am hoping you have found a solution as I have the same requirement... what did you end up using?
Thanks for any help...
|
|
|
|
|
i want the Imgocxd.hlp file im working on image scanning and saving it to hard disk if any one have it then pls giv me
Shahbaz kiani
|
|
|
|
|
Hi Everyboday,
While installing global message hook (WH_GETMESSAGE) on WinXP limited
user account i am getting "Access Denied" error.
The same code is working fine on Win2k machines (in any user mode)
I have written a dll in which all my global hook stuff resides, which
has some export function to install/uninstall the global hook.
Can any body please guide me what i am doing wrong here ?
Thank you,
Vishal
VM
|
|
|
|
|
Yup problem solved
Vishal
|
|
|
|
|
every body....
my code is following.
my problem is only photo2 is show.
i want to show both photo1 and photo2.plz help me...
//MyView.h
CStatic m_photo1;
CStatic m_photo2;
HBITMAP m_hBmpOld;
HBITMAP m_hBmpNew;
BITMAP m_bmInfo;
//MyView.cpp
void CMyView::OnOK()
{
Load_Photo_1("image/1.bmp");
Load_Photo_2("image/2.bmp");
}
void CMyView::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CPaintDC dc(this);
dc.BitBlt(offsetx,offsety,m_size.cx,m_size.cy,
&m_dcMem, sourcex, sourcey,SRCCOPY);
CFormView::OnPaint();
}
}
void CMyView::OnInitialUpdate()
{
CClientDC dc(this);
m_dcMem.CreateCompatibleDC( &dc );
}
void CMyView::Load_Photo_1(CString p_filepath)
{
m_hBmpNew = (HBITMAP) LoadImage(
AfxGetInstanceHandle(),
p_filepath,
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE);
if( m_hBmpNew == NULL )
{
AfxMessageBox("Load Image Failed");
}
else
{
m_photo1.GetClientRect( &rectStaticClient );
rectStaticClient.NormalizeRect();
m_size.cx=rectStaticClient.Size().cx;
m_size.cy=rectStaticClient.Size().cy;
m_size.cx = rectStaticClient.Width(); // zero based
m_size.cy = rectStaticClient.Height(); // zero based
m_photo1.ClientToScreen( &rectStaticClient );
ScreenToClient( &rectStaticClient);
m_pt.x = rectStaticClient.left;
m_pt.y = rectStaticClient.top;
GetObject( m_hBmpNew , sizeof(BITMAP), &m_bmInfo );
VERIFY(m_hBmpOld = (HBITMAP)SelectObject(m_dcMem, m_hBmpNew));
offsetx= m_pt.x;
offsety=m_pt.y;
InvalidateRect(&rectStaticClient);
}
}
void CMyView::Load_Photo_2(CString p_filepath)
{
m_hBmpNew = (HBITMAP) LoadImage(
AfxGetInstanceHandle(),
p_filepath,
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE);
if( m_hBmpNew == NULL )
{
AfxMessageBox("Load Image Failed");
}
else
{
m_photo2.GetClientRect( &rectStaticClient );
rectStaticClient.NormalizeRect();
m_size.cx=rectStaticClient.Size().cx;
m_size.cy=rectStaticClient.Size().cy;
m_size.cx = rectStaticClient.Width(); // zero based
m_size.cy = rectStaticClient.Height(); // zero based
m_photo2.ClientToScreen( &rectStaticClient );
ScreenToClient( &rectStaticClient);
m_pt.x = rectStaticClient.left;
m_pt.y = rectStaticClient.top;
GetObject( m_hBmpNew , sizeof(BITMAP), &m_bmInfo );
VERIFY(m_hBmpOld = (HBITMAP)SelectObject(m_dcMem, m_hBmpNew));
offsetx= m_pt.x;
offsety=m_pt.y;
InvalidateRect(&rectStaticClient);
}
}
|
|
|
|
|
definitely.....only the photo2 will get loaded.....
u have defined only one dcmemory variable.....
and u have assigned both the photoz to that same dcmemory variable.....
since the first gets assigned to the "m_dcMem".....what happens is u assign even the second photo to the same variable "m_dcMem" so the first getz overwritten.....
use two seperate variables :m_dcMem1 and m_dcMem2
that should sove the prob.....
happy programmin.....
cheerz.....
|
|
|
|
|
and oh.....i forgot,therz one more thing.....
in ur paint function.....make sure u give two BitBlts.....
that iz....
dc.BitBlt(offsetx1,offsety1,m_size1.cx,m_size1.cy,&m_dcMem1, sourcex1, sourcey1,SRCCOPY);
dc.BitBlt(offsetx2,offsety2,m_size2.cx,m_size2.cy,&m_dcMem2, sourcex2, sourcey2,SRCCOPY);
i hope u got that as well.....
happy programmin.....
cheerz.....
|
|
|
|
|
i understand ...
thank you...
|
|
|
|
|
I have a socket server application that uses async sockets and a completeion port.
We have installed it at a new client site in Sydney and they have some users in London, Sydney and New York. The London users only are reporting that the client application gets disconnected from time to time. This is not reproducible using the UAT environment at the client site.
Sometimes when we call ::send() in the server SOCKET_ERROR is returned and WSAGetLastError() returns WSAEWOULDBLOCK. I believe this is because windows is still performing the last send operation on this socket.
In this case we call ::select() with the socket in the writefds param and a timeout. This code has always worked successfully in the past. What I find now is that for these London users ::select()is returning a value other than 1. Unfortunately the exact value returned is not logged by the sever. I have had the customer increase the timeout value that is passed to the ::select() call but it is still failing. Anyone got any bright ideas?
|
|
|
|
|
FWIW different socket implementations support different subsets of the select options. You might want to check if the winsock on the problem machine is the same as the others. Just a thought.
|
|
|
|
|
If i use WriteFile to write over a file with null bytes, will it actually write over the existing bytes on the drive or will it just write them to a new location on the drive.
|
|
|
|
|
It will write over the bytes
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
Yes
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
There are to threads:
//thread one:
CSingleLock m_lock(&syn_object);
m_lock.Lock();
/*
.....Doing something
*/
m_lock.UnLock();
/=================================
thread two:
CSingleLock m_lock(&syn_object);
m_lock.Lock();
while (!m_lock.IsLocked());
//continue to do something if thread one finished with thre resource
I want the thread two to wait for the thread one finished 'doing something' before continue but the whole program seems to crash here.
|
|
|
|
|
lisoft wrote:
m_lock.Lock();
while (!m_lock.IsLocked());
Your will always hang on the while line as you just locked m_lock on the previous line.
There is no need to check the lock state as the code will wait on the m_lock.Lock() line until thread one has unlocked the lock.
Remove the while and your code should work better.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Your
while (!m_lock.IsLocked());
will never execute because m_lock will always be locked at that step.
Your request cries out for a manual reset event but it looks like you are using something other than an event.
John
|
|
|
|
|
What should I do to let thread two waiting until the thread one finish?
|
|
|
|
|
If I remember right the lock function does not return until it has managed to lock. So checking it is lock after call lock is redundant. The purpose of locking is to allow a thread to manipulate the data with messing up another threads actions. In other words only one thread can read or modify the data at a given time. You do not want to try to copy a string while anouther thread is modifying that same string.
So the answer is YES! Before thread two can work with the data thread one has to stop working with it. Before thead one can work with the data thread two has to stop working with it. The individual threads do not have to stop they just have to stop accessing the shared data long enough for anouther thread to access it.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
You do:
Somewhere define an event that both threads know about:
HANDLE hEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
which is a manual reset event with unsignalled state to begin with.
Then in your worker thread:
// Do something, stuff, thing or whatever...
// Ok Ready, signal the event
::SetEvent(hEvent);
Then in thread 2 you just wait for the event
// Wait for event to be signalled
::WaitForSingleObject(hEvent, INFINITE);
Execution will continue after the ::WaitForSinglObject as soon as the event
gets signalled.
|
|
|
|
|
Hi,
I am developing a windows COM client application and also a COM server at the same time.
In my workspace there are basically 2 projects, the GUI COM client project and the COM server project.
Before messing around with DEBUG and Release build settings, I was able to setup breakpoints in the COM server code in DEBUG mode and Visual would actually break in that code.
However, I messed around with the DEBUG and Release build settings in order ot test my code in Release mode, and now it doesn't break. I am able to still break in the GUI COM client code just fine but can't break in the COM server code, even when I have the COM server project as the active project.
Anyone know how to fix this?
Thanks in advance!
|
|
|
|
|
It sounds like it is not compiled for debugging or the IDE disabled the break points, when you ran it in release mode. You may need to reset the break points and or rebuild all in debug mode.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Thanks for your reply.
I have checked and recompiled but to no avail. However I just found the solution today and it was a silly mistake on my part. I compiled a release version of my COM Server and regsvr32'd it. When I compiled the DEBUG version the reg script didn't seem to work so all this time I have been trying to step into a RELEASE version of the dll.
Thanks again!
|
|
|
|