|
Hi,
I use VC6 (SP5) in Windows XP Pro (SP1). I wanted to add Greek/Chinese strings. I edited the .rc files in a Unicode editor, saved the file as UTF-8. But, now, VC6 has problems handling the file. But, if I save it as a normal file, the strings are garbled.
How do I add other language strings to my resource file and what shd I use to compile it?
TIA
MRK
|
|
|
|
|
I've noticed that VC6 has problems in dealing with language strings, especially unicode characters. What we do normally is create the structure of the resource file using the VC resource editor, then have the translators to use their text editor (I think they use TextPad), re-include the modified resource file in Visual Studio. DO NOT modifiy in any way the file after it has been translated - do not change dialogs, not accelerators, nothing. If you do get a saved copy of the translated version and copy and paste the text using a text editor to replace the garbled text.
VC7 seems to have addressed the problem.
Hope that helps.
|
|
|
|
|
I want to make a wizard. For example i have four dialogs. The last one is my main dialog.
Now i open the first dlg. From this dlg i want to open the next dlg with a button, but the first one doesn´t close.
How can i check if the second dlg is opened and i´m able to close the first one.
maybe there is another way to create a wizard!?
J.J.
|
|
|
|
|
|
|
I have source code for a DLL created in C++ .net, I want to debug this.
I have created a second project (console application ) in the same solution ,for calling a particular function from the first project and passing parameter to it.
But when I tried to call that function
int DNAPrintExport InstallPrinter(const char* cpstrPrinterData)
{
}
using the following code in the second project
int abc=InstallPrinter("Hello");
I am getting error C2065: 'InstallPrinter' : undeclared identifier
Can anybody help me to do this please
Thanks in advance
Jayakrishnan
|
|
|
|
|
Have a look here[^] and see how _declspec(dllimport) is used to import a function from a DLL to another application.
|
|
|
|
|
Dear all,
I am using Visual C MFC Dialog-based application to obtain USB data from a Cypress chip. DeviceIoControl(IOCTL_EZUSB_BULK_READ...)... I am doing this using multithreading method. However, I face a problem when I compile. This is part of my program:
UINT SendOpThread(LPVOID pParam)
{
int bResult;
CThreadInfo* pTh = (CThreadInfo*)pParam;
BULK_TRANSFER_CONTROL2 btc;
btc.pipeNum = 0;
DeviceHandle = CreateFile("\\\\.\\ezusb-0",
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
bResult = DeviceIoControl (DeviceHandle,
IOCTL_EZUSB_BULK_READ,
&btc,
sizeof (BULK_TRANSFER_CONTROL),
r_Buffer,
sizeof(r_Buffer),
&nBytes,
NULL);
CloseHandle(DeviceHandle);
wsprintf(str, "r_Buffer[%d]: %04X\n", i,r_Buffer[i]);
SendDlgItemMessage(IDC_OUTPUT6,
LB_ADDSTRING,
0,
(LPARAM)(LPCTSTR) str);
return(bResult);
}
void CUSB1Dlg::OnBulkRead()
{
// TODO: Add your control notification handler code here
int Code=1;
stream1 = fopen("data.txt","a+") ;
myWinThread = AfxBeginThread(SendOpThread, &Code, THREAD_PRIORITY_HIGHEST,0,CREATE_SUSPENDED);
myWinThread->m_bAutoDelete=FALSE;
myWinThread->ResumeThread();
.
.
.
}
When I compile, I got this error:
'SendDlgItemMessageA' : Function does not take 4 parameters
I found from the Help:
SendDlgItemMessage consists of 3 types: which is CWnd, CWindow, & Windows User Interface. Which 1 should the thread belongs to?
I assumed that it belongs to WUI, and so it requires HWND hDlg, a handle of dialog box. Since I am using Dialog-based application where the dialog is already created, how should I put for the hdlg parameter?
I really wish that someone could help me...
Einly
|
|
|
|
|
OK, here's my 2 cents worth. You can change the code slightly by using
CWnd* pWnd = GetDlgItem(IDC_OUTPUT6);
if (pWnd)
{
pWnd->SendMessage(LB_ADDSTRING, 0, (LPARAM)(LPCTSTR)str);
}
assuming, of course, this happens in a dialog member function.
If not, and it's in something like a worker thread, as part of the thread parameter block, you need something more complex than a simple int.
Perhaps
struct paramblock {
int code;
HWND hWnd;
};
would help
Then get the HWND before invoking the AfxBeginThread, and use the WINAPI version.
As a rule, you can specify you want that version by using the global scope prefix '::'
eg ::SendMessage(param.hWnd, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR)str);
Hope this helps
Steve S
|
|
|
|
|
Thanks for your reply. Sorry that I am quite poor in Visual C. May I know how do I get hWnd? hWnd=??? My objective is to output some message in my worker thread. So, let say...
UINT SendOpThread(LPVOID pParam)
{
int bResult;
CThreadInfo* pTh = (CThreadInfo*)pParam;
BULK_TRANSFER_CONTROL2 btc;
btc.pipeNum = 0;
DeviceHandle = CreateFile("\\\\.\\ezusb-0",
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
bResult = DeviceIoControl (DeviceHandle,
IOCTL_EZUSB_BULK_READ,
&btc,
sizeof (BULK_TRANSFER_CONTROL),
r_Buffer,
sizeof(r_Buffer),
&nBytes,
NULL);
CloseHandle(DeviceHandle);
wsprintf(str, "r_Buffer[%d]: %04X\n", i,r_Buffer[i]);
::SendDlgItemMessage(pParam2.hWnd, LB_ADDSTRING,
0,
(LPARAM)(LPCTSTR) str);
return(bResult);
}
void CUSB1Dlg::OnBulkRead()
{
// TODO: Add your control notification handler code here
struct paramblock{
int Code=1;
HWND hWnd;
};
What should I write here?
stream1 = fopen("data.txt","a+") ;
myWinThread = AfxBeginThread(SendOpThread, here??pPar, THREAD_PRIORITY_HIGHEST,0,CREATE_SUSPENDED);
myWinThread->m_bAutoDelete=FALSE;
myWinThread->ResumeThread();
.
.
.
}
Einly
|
|
|
|
|
Thanks for your reply. Sorry that I am quite poor in Visual C. May I know how do I get hWnd? hWnd=??? My objective is to output some message in my worker thread. So, let say...
UINT SendOpThread(LPVOID pParam)
{
int bResult;
CThreadInfo* pTh = (CThreadInfo*)pParam;
BULK_TRANSFER_CONTROL2 btc;
btc.pipeNum = 0;
DeviceHandle = CreateFile("\\\\.\\ezusb-0",
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
bResult = DeviceIoControl (DeviceHandle,
IOCTL_EZUSB_BULK_READ,
&btc,
sizeof (BULK_TRANSFER_CONTROL),
r_Buffer,
sizeof(r_Buffer),
&nBytes,
NULL);
CloseHandle(DeviceHandle);
wsprintf(str, "r_Buffer[%d]: %04X\n", i,r_Buffer[i]);
::SendMessage(pParam2.hWnd, LB_ADDSTRING,
0,
(LPARAM)(LPCTSTR) str);
return(bResult);
}
void CUSB1Dlg::OnBulkRead()
{
// TODO: Add your control notification handler code here
struct paramblock{
int Code=1;
HWND hWnd;
};
What should I write here?
stream1 = fopen("data.txt","a+") ;
myWinThread = AfxBeginThread(SendOpThread, here??pPar, THREAD_PRIORITY_HIGHEST,0,CREATE_SUSPENDED);
myWinThread->m_bAutoDelete=FALSE;
myWinThread->ResumeThread();
.
.
.
}
Einly
|
|
|
|
|
im trying to construct a GDI+ Image object from an IStream;
the IStream is created on global memory successfully and assigned valid image data but, when i try
image = ::new Image(stream)
laststatus says something about wrong/incorrect arguments
("InvalidParameter" i think)
has anybody tried this ?
|
|
|
|
|
Did you rewind the stream? I.e. pStream->Seek(0, STREAM_SEEK_SET, 0)?
--
Try walking in my shoes. You stumble in my footsteps.
|
|
|
|
|
never knew i had to !
Thank you for the hint - will give it a try
|
|
|
|
|
I've run into that problem a couple of times.
--
Try walking in my shoes. You stumble in my footsteps.
|
|
|
|
|
nope, doesnt work still
the GDI+ Image still has property nativeImage = 0x00
and lastResult is InvalidParameter
any other ideas ?
|
|
|
|
|
Sorry, I'm out of ideas.
--
Try walking in my shoes. You stumble in my footsteps.
|
|
|
|
|
thanx, Jörgen
i think i found the cause - its actually not the IStream, but the GIF image data inside of it that makes the Image constructor fail. When i exported the GIF image and saved it anew (in acdsee) - the new file is slightly different and Image aquires it without problems.
I'll be digging it some more, but its a different matter now
thanx again
see you around
|
|
|
|
|
Hello,
can please someone explain me, how modeless dialogs are working ?
Does they have their own message queue ?
Which thread is processing their messages ? (When I have one threaded
application which just created couple od modeless dialogs) ?
rrrado
|
|
|
|
|
Message Q's are on a per-thread basis - each modeless dialog your thread creates will be serviced by the same message Q - it's the magic call(s) to IsDialogMessage in the message pump that translates the keyboard messages for each dialog.
|
|
|
|
|
Thanks !
rrrado
|
|
|
|
|
I make an Application running on PocketPC, but I don't know how to get current directory for my App.
Ex: I put my App in \Program files\MyApp\
When I change its location, I can't read my data file in the newfolder!
Ex: I change its location to: \MyApp1\
HonestRing
|
|
|
|
|
GetModuleFileName will give you the path and filename, all you'll need to do is strip the filename from the end and replace it with your data file name.
Have a look on MSDN for more info, as the function may not be supported by all devices.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
I am working on a functionality just opposite to what the Microsoft Depends does. Rather than finding out the dependencies of an exe/dll I need to list down the exe's/dll's dependent upon a particular function in a library.
Is there any such utility available? Or can I get some help on the same?
|
|
|
|
|
Hi everybody,
I would like to know if someone could tell me if a debugger made to find memory leak problem exist for windows environment & if it's ok where i could find it? Some of my friends tell me about a software called "valgrind" which only works under linux environment!
Thanks in advance for yours answers
Gerald
|
|
|
|
|