|
I'm assuming your CreateInstance has failed. What is the HResult returned from it.
I usually create a Crystal instance using
HRESULT hr = m_Application.CreateInstance(__uuidof(Application));
What exception is thrown? Have you added an exception handler to get more details of the exception?
try<br />
{<br />
m_pReport = m_pApplication->NewReport();<br />
}<br />
catch(_com_error& e)<br />
{<br />
TRACE("COM Error: %s %s %x\n", e.ErrorMessage(), (LPCTSTR)e.Description(), e.Error());<br />
}
Michael
CP Blog [^]
|
|
|
|
|
Dear all,
I am using Microsoft VS 6 and when I first built my program's project with the app wizard I select the English Language for "what language would you like your resources in?".
My question is: after I have built the project, can I change the language DLL? The reason is becuase my software needs to work for several languages. In fact I am running a Chinese version of Windows and all the Chinese displays on using the English DDL, EXCEPT the list control. When Chinese is displayed in it, it comes out as rubbish. This is not the case with drop-down menus and text boxes? Anyone know why this might be?
I tried building a test project with just a List Control but used the Chinese DLL and it seems to be ok. So I am wondering if I can change the DLL my program uses now that I have built my program already with the English one.
Any help would much appreciated.
Graham.
|
|
|
|
|
Hi all,
This is my first post in this A-real-time-code-site( The Code Project).
Before 2 months I purchased the Visual Studio.NET the acadimic version, and since that time I was trying to do some coding in Visual C++.net, VB.net and some smart phone applications. But the problem is that I don't know why so far I don't have the touch for that, I mean I have ideas but I can't deal with the .NET thing??!! putting in mind that Back in my electronic and telecomunnication school I was able to do many coding in the C++ ( Borland builder and others), But when I migrate to .NET, BANG, I don't have a clue.
Maybe it's like what MORPHUSE told NEO in ( The Matrix) " Knowing the path is not like wlaking on the path".
So please I need your advices and some tips and some really good books that you guys have worked with it.
Best Regards.
(C++) + simplicity = C++.net PRO.
|
|
|
|
|
hi there,
i'm trying to make a class capable of playing wave files and returning play position and levels.
i'm using MCI functions and, for the most of it, it works ok.
for example, i get the play position using MCI_STATUS_POSITION:
DWORD CWave::GetPosition()
{
DWORD lnPos=0;
DWORD lnErr;
MCI_STATUS_PARMS loStatus;
loStatus.dwCallback=NULL;
loStatus.dwItem=MCI_STATUS_POSITION;
lnErr=mciSendCommand(m_nDeviceID, MCI_STATUS, MCI_STATUS_ITEM |MCI_STATUS_POSITION| MCI_WAIT,(DWORD) (LPMCI_STATUS_PARMS)&loStatus);
if(!lnErr)
{
lnPos=loStatus.dwReturn;
}
else
{
UINT lnErrL;
char * lsErr;
if(mciGetErrorString(lnErr,lsErr, lnErrL))
AfxMessageBox(lsErr,MB_ICONERROR);
else
AfxMessageBox("An unknown error occured",MB_ICONERROR);
}
return lnPos;
}
but i can't understand why MCI_WAVE_STATUS_LEVEL returns an error: "MMSYSTEM 322: All wave devices that can record files in this format are in use."
DWORD CWave::GetLevels()
{
DWORD lnLevels=0;
DWORD lnErr;
MCI_STATUS_PARMS loStatus;
loStatus.dwCallback=NULL;
loStatus.dwItem=MCI_WAVE_STATUS_LEVEL;
lnErr=mciSendCommand(m_nDeviceID, MCI_STATUS, MCI_STATUS_ITEM |MCI_WAVE_STATUS_LEVEL| MCI_WAIT,(DWORD) (LPMCI_STATUS_PARMS)&loStatus);
if(!lnErr)
{
lnLevels=loStatus.dwReturn;
}
else
{
DisplayErrorMsg(lnErr,"Error while getting levels");
}
return lnLevels;
}
....can anyone help???
|
|
|
|
|
Hi,
I have to write a program that will talk to a device through USB. In the past I have built a program that is able to talk to devices through the RS232 COM ports. In this case Windows abstracts the Serial ports as just file handles. My question is, how exactly do I get at a USB device from a Visual C++ program? Are there Win32 API functions that will do it for me?
I have found lots of information about writing Windows USB drivers and they all say it is difficult because you need to have an understanding of the Windows kernel. However I don't think this information applies to me beacuse I just basically want to send bytes down to a USB device.
Thanks in advance!
|
|
|
|
|
If you can, try to find a virtual serial port driver for your device which will map USB into something which will work with the WriteFile API. We used this approach for working with bluetooth USB dongles on our last project and it worked quite well.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Gud Morning sir,
[quote author=Andrew Walker]
try to find a virtual serial port driver for your device which will map USB into something which will work with the WriteFile API
[/quote]
Could you provide some link fir that type of Software
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks for all your responses. It seems like this is the most straightforward way because I already have code that talks through RS232.
I will investigate this. But if you have any links it would be great
Thanks!
|
|
|
|
|
How can I find out what exactly is causing my memory leak. At least the one in the program
Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\hnetcfg.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wshtcpip.dll', no matching symbolic information found.
The thread 0xE44 has exited with code 0 (0x0).
The thread 0x7C0 has exited with code 0 (0x0).
The thread 0xF60 has exited with code 0 (0x0).
Warning: calling DestroyWindow in CDialog::~CDialog --
OnDestroy or PostNcDestroy in derived class will not be called.
Detected memory leaks!
Dumping objects ->
strcore.cpp(118) : {320} normal block at 0x00329080, 16 bytes long.
Data: < txt > 01 00 00 00 03 00 00 00 03 00 00 00 74 78 74 00
strcore.cpp(118) : {318} normal block at 0x00329028, 22 bytes long.
Data: < Batc> 01 00 00 00 09 00 00 00 09 00 00 00 42 61 74 63
strcore.cpp(118) : {303} normal block at 0x00328FD0, 15 bytes long.
Data: < 29 > 01 00 00 00 02 00 00 00 02 00 00 00 32 39 00
strcore.cpp(118) : {301} normal block at 0x00328F78, 15 bytes long.
Data: < 12 > 01 00 00 00 02 00 00 00 02 00 00 00 31 32 00
strcore.cpp(118) : {299} normal block at 0x00328F20, 17 bytes long.
Data: < bbcc> 01 00 00 00 04 00 00 00 04 00 00 00 62 62 63 63
strcore.cpp(118) : {294} normal block at 0x00328EC8, 14 bytes long.
Data: < 9 > 01 00 00 00 01 00 00 00 01 00 00 00 39 00
strcore.cpp(118) : {292} normal block at 0x00328E70, 14 bytes long.
Data: < 1 > 01 00 00 00 01 00 00 00 01 00 00 00 31 00
strcore.cpp(118) : {290} normal block at 0x00328E18, 15 bytes long.
Data: < aa > 01 00 00 00 02 00 00 00 02 00 00 00 61 61 00
strcore.cpp(118) : {287} normal block at 0x00328DC0, 19 bytes long.
Data: < MOD > 01 00 00 00 06 00 00 00 06 00 00 00 4D 4F 44 20
strcore.cpp(118) : {284} normal block at 0x00328D68, 25 bytes long.
Data: < OCRA> 01 00 00 00 0C 00 00 00 0C 00 00 00 4F 43 52 41
strcore.cpp(118) : {282} normal block at 0x00328D10, 14 bytes long.
Data: < 3 > 01 00 00 00 01 00 00 00 01 00 00 00 33 00
strcore.cpp(118) : {280} normal block at 0x00328CB8, 14 bytes long.
Data: < 2 > 01 00 00 00 01 00 00 00 01 00 00 00 32 00
strcore.cpp(118) : {278} normal block at 0x00328C60, 14 bytes long.
Data: < 1 > 01 00 00 00 01 00 00 00 01 00 00 00 31 00
strcore.cpp(118) : {233} normal block at 0x00328858, 21 bytes long.
Data: < Item> 01 00 00 00 08 00 00 00 08 00 00 00 49 74 65 6D
strcore.cpp(118) : {231} normal block at 0x00328670, 17 bytes long.
Data: < HJTF> 01 00 00 00 04 00 00 00 04 00 00 00 48 4A 54 46
strcore.cpp(118) : {229} normal block at 0x00329C88, 15 bytes long.
Data: < V4 > 01 00 00 00 02 00 00 00 02 00 00 00 56 34 00
strcore.cpp(118) : {228} normal block at 0x00329C20, 38 bytes long.
Data: < 3 it> 01 00 00 00 19 00 00 00 19 00 00 00 33 20 69 74
strcore.cpp(118) : {227} normal block at 0x00329BC8, 22 bytes long.
Data: < item> 01 00 00 00 09 00 00 00 09 00 00 00 69 74 65 6D
strcore.cpp(118) : {226} normal block at 0x00329B70, 17 bytes long.
Data: < HJTF> 01 00 00 00 04 00 00 00 04 00 00 00 48 4A 54 46
strcore.cpp(118) : {225} normal block at 0x00329B18, 15 bytes long.
Data: < V4 > 01 00 00 00 02 00 00 00 02 00 00 00 56 34 00
strcore.cpp(118) : {224} normal block at 0x00329AC0, 22 bytes long.
Data: < 1 it> 01 00 00 00 09 00 00 00 09 00 00 00 31 20 69 74
strcore.cpp(118) : {223} normal block at 0x00329A68, 20 bytes long.
Data: < item> 01 00 00 00 07 00 00 00 07 00 00 00 69 74 65 6D
strcore.cpp(118) : {222} normal block at 0x00329A10, 17 bytes long.
Data: < HJTF> 01 00 00 00 04 00 00 00 04 00 00 00 48 4A 54 46
strcore.cpp(118) : {221} normal block at 0x003299B8, 15 bytes long.
Data: < V4 > 01 00 00 00 02 00 00 00 02 00 00 00 56 34 00
strcore.cpp(118) : {220} normal block at 0x00329950, 32 bytes long.
Data: < 2 I> 02 00 00 00 13 00 00 00 13 00 00 00 20 32 20 49
strcore.cpp(118) : {219} normal block at 0x003298F8, 21 bytes long.
Data: < Item> 01 00 00 00 08 00 00 00 08 00 00 00 49 74 65 6D
strcore.cpp(118) : {218} normal block at 0x003298A0, 17 bytes long.
Data: < HJTF> 01 00 00 00 04 00 00 00 04 00 00 00 48 4A 54 46
strcore.cpp(118) : {133} normal block at 0x00326028, 16 bytes long.
Data: < END > 01 00 00 00 03 00 00 00 03 00 00 00 45 4E 44 00
strcore.cpp(118) : {82} normal block at 0x00325040, 18 bytes long.
Data: < phil> 01 00 00 00 05 00 00 00 05 00 00 00 70 68 69 6C
strcore.cpp(118) : {52} normal block at 0x00324578, 54 bytes long.
Data: < ) ) C:\P> 01 00 00 00 29 00 00 00 29 00 00 00 43 3A 5C 50
strcore.cpp(118) : {51} normal block at 0x00324520, 22 bytes long.
Data: < C:\B> 01 00 00 00 09 00 00 00 09 00 00 00 43 3A 5C 42
Object dump complete.
The thread 0xA1C has exited with code 3 (0x3).
The program 'C:\AWork\Data Reply\Ranger\Scanner\Debug\Scanner.exe' has exited with code 3 (0x3).
|
|
|
|
|
There is no memory leak
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
How could you say that GoodMast3r??could you explin that please
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
|
Ok.... there wasn't a memory leak in my program.....
It turns out I was writing over the end of an array of struct (by 1). It was bad programming.
However, it did confuse the runtime into thinking there was a leak, but at least it said something.
Thanks everyone.
Phil
|
|
|
|
|
Hi,
Think that the leak is related to a string variable having the values at some stage as text, Batc, ..... shown within Data:<..>.
This may help you
Sujan
|
|
|
|
|
What is the most portable way to do it? I want to make it fullscreen just like IE does it: no caption bar, no borders, no task bar. Currently I'm just removing the WS_OVERLAPPEDWINDOW bits and sets window state to SW_MAXIMIZED. It does work on my Windows XP work machine without a glitch, but does not cover the task bar on another Windows XP machine. Obviously I'm doing something wrong, which just happens to work on my machine. Any ideas?
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
Are you bright too?[^]
|
|
|
|
|
Gud Morning Sir,
i think after doing all the thing you have stated,
you can use MoveWindow() to increase the size of window
to cover the task bar.
and you can Get current Screen Resolution by using
these api's
-->int GetSystemMetrics(
int nIndex // system metric or configuration setting
);
----->BOOL SystemParametersInfo(
UINT uiAction, // system parameter to retrieve or set
UINT uiParam, // depends on action to be taken
PVOID pvParam, // depends on action to be taken
UINT fWinIni // user profile update option
);
Sorry If i wrong
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Why is the simplest solution sometimes so hard to see?? Thanks!
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
Are you bright too?[^]
|
|
|
|
|
Jörgen Sigvardsson wrote:
Thanks!
it's Great to hear Thanks From a Great personality like you,i love to remeber this day fro life long
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
adding to above: (Not) covering the task bar is probably caused by different "Auto Hide" settings for it.
we are here to help each other get through this thing, whatever it is Vonnegut jr. boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
I am using IE browser in my app to display a bunch of data.
I have some HTML as a resource and I have a bunch of data laid out in a table. I have given IDs to the various <td> tags, each one unique.
I add an event handler in my MFC code that get an OnNavigateComplete call back. Here I can get the document from the browser object, and then search for the element by ID, and then replace the text value in it. Works great. EXCEPT:
When I put in a <SCRIPT> tag in the html! Then NO elements are found with ANY id's. Is this a known bug? Is there something else I am doing wrong? Is there a better place to post this than here?
<i>¡El diablo está en mis pantalones! ¡Mire, mire!</i>
<i>Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!</i>
<font size="1" color="black">SELECT * FROM <b>User</b> WHERE <b>Clue</b> > 0
<b>0 rows returned</b>
</font>
|
|
|
|
|
Never mind!
The problem is where you "post process" the HTML programatically. If you do it in the NavigateComplete event then things get funky. If you use the DocumentComplete event, then you're golden! Woot!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Can someone please explain to me why, when u exceed 20 characters input, it doesnt stop but just keeps on accepting input, and somehow ends up passing through the loop a few times instantaneously?
I mean.. just try typing in some 60 characters or so to see what i mean:
#include <stdio.h>
int IsPalindrome(const char*);
int main(void)
{
char str[21]={NULL};
int i=0;
char c=NULL;
do
{
if(str[0]!=NULL)
{
if(IsPalindrome(str))
printf("This is a palindrome!\n");
else
printf("This isn't a palindrome.\n");
}
i = 0;
while((c=getchar())!='\n' && i<21)
{
if((c>='a' && c<='z') || c=='$')
{
str[i] = c;
i++;
}
}
str[i] = NULL;
} while(str[0]!='$');
return 0;
}
int IsPalindrome(const char* str)
{
int len=0, i=0;
while(str[len++]!=NULL) {}
len--;
for(i=0;i<len;i++)
{
if(str[i]!=str[(len-1)-i])
return 0;
}
return 1;
}
Kuniva
--------------------------------------------
|
|
|
|
|
Change the while loop to:
while((c = getche()) != 0x0d && i<21)
For the IsPalindrome() function, why not just call strrev() followed by strcmp() ?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Because we couldn't use string functions. And I don't see how u explain what happens here..
Kuniva
--------------------------------------------
|
|
|
|
|
Kuniva wrote:
Because we couldn't use string functions.
Fair enough.
Kuniva wrote:
And I don't see how u explain what happens here..
What's to explain? I trust you know that getchar() buffers input while getche() does not. That's why I suggested using it.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|