|
thanx avenger for ur suggestion bout windows programming....
|
|
|
|
|
Here is my unresolved problem: I spoke about it last Friday but I have still no solutions for resolving it:
Description of the problem:
I use a function "PESDEMUX_ProcessFile" which is defined in the file "XtlPes.dll". This function allows me to convert file from one type to another.
I work on a device which is controled by my computer with the SERIAL or the USB port.
When I am on SERIAL Mode for controling the device, I have to transfer the file by USB port from the device to my computer and the function "PESDEMUX_ProcessFile" does the conversion. (I have to open and close a USB communication port for that). Here is there no problems.
Now, when I am on USB Mode for controling the device, I have to transfer the file by USB port too from the device to my computer and the function "PESDEMUX_ProcessFile" may does the conversion too. But I have a Visual C++ error: "Unhandled exception in Appli.exe (XTLPES.DLL): 0xC0000005: Access Violation." With the "Call Stack" option in Visual C++, I see that there is a problem at that line: "00E34F3D mov eax,dword ptr [esi+304h]".
Here is the code I used for caling the function "PESDEMUX_ProcessFile":
typedef LONG (__cdecl *PESDEMUX_ProcessFile)(CHAR*,CHAR*,INT);
PESDEMUX_ProcessFile pProcessFile;
CHAR chInFileName[255];
strcpy(chInFileName, m_csPCFileName); //Conversion CString to CHAR*
CHAR chOutFileName[255];
m_csPCFileName = m_csPCFileName + ".mpg";
strcpy(chOutFileName, m_csPCFileName); //Conversion CString to CHAR*
INT Type = 1;
if (theApp.g_hDllXtlPes != NULL)
{
pProcessFile = (PESDEMUX_ProcessFile)GetProcAddress(theApp.g_hDllXtlPes,"PESDEMUX_ProcessFile");
if (!pProcessFile)
{
FreeLibrary(theApp.g_hDllXtlPes);
return FALSE;
}
else
{
BOOL BResult = TRUE;
BResult = pProcessFile(chInFileName,chOutFileName,Type);
if (BResult == FALSE)
{
TRACE("Conversion Process OK\n");
}
else
TRACE("Conversion Process non OK\n");
}
}
With HINSTANCE g_hDllXtlPes = LoadLibrary("XtlPes.dll"); defined in another .cpp file.
Do you have any ideas on that curious problem ?
Thank's for advance,
|
|
|
|
|
Do u really think it helps when you ask two times?
I've read the last article and I won't read it again.
Don't try it, just do it!
|
|
|
|
|
You really are not the most helpful person, Alexander
|
|
|
|
|
It's a hard problem and I need to solve it as soon as possible...
But nobody can help me...
|
|
|
|
|
A possibility may be that you ha ve No Access priveleges in windows NT related. I got the same problem trying to access paralle port using the _outp function. You probably have the same problem, but no garantee here.
|
|
|
|
|
I'm trying to create a simple application using C++ and MFC that is able to retrieve some hardware & general information of my pc and show it on the screen rather than having to check manually.
Examples of information to be retrieved include:
-Machine Name, Date Created, IP address of my pc, Memory, Users, Last Logon, Last Logoff and etc
1) How to get all this information thr C++ codes?
2) Any website that provide relevant codes or samples?
Best Regards,
xiAoYJia
|
|
|
|
|
I can remember some articles about that on CP, search...!
Don't try it, just do it!
|
|
|
|
|
Hey, the following page provides you with more than enough information. Just select the functions of your choice and see the SYNTAX. All these are WINDOWS API (VC++) functions. They can of course be used in console mode C++ programs compiled under Visual Studio5.0 or above.
Link::
System Information functions at MSDN, microsoft(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/system_information_functions.asp)
A few functions are namely GetComputerName, GetCurrentHwProfile, GetSystemInfo, GetSystemMetrics(Very Important ), GetUserName, SystemParametersInfo etc. etc. etc.
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
...avenger
|
|
|
|
|
How to check if the IE's Address Bar has got the focus in VC++ program : O.S Windows98
|
|
|
|
|
|
Im new to VC7, and Im getting link errors that can be fixed using "project" -> "settings" in VC6.0 and linking the appropriate .lib file but how is it done in VC7
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
will this help
#pragma comment(lib,"libname.lib")
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
That did the trick,
Thanks a million.
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
How do I disable a net adapter? thanks in advance!
|
|
|
|
|
net stop <servicename>
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
are u sure?
net stop stops a service, so if there are 2 (e.g.) realtek cards they will both stop.
Don't try it, just do it!
|
|
|
|
|
hi guys,
I found that every program I wrote it require attach .dll files and the file after compile is very big (static dll), but some programe is very small, I wonder how can they do to decrease kb ?
thanks.
|
|
|
|
|
Huu Tu wrote:
very big (static dll), but some programe is very small
Learn to program in ATL
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
ATL doesn't make your files smaller... if you really want a small file, then use assembler or remove all CRT code from the file.
Don't try it, just do it!
|
|
|
|
|
Your english is terrible, I don't understand your problem!
Don't try it, just do it!
|
|
|
|
|
From the "project manager" (PROJECT>SETTINGS>LINK), remove all the unnecessary .lib files from the LINK tab that you dont need in your program. This may help
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
Hi
My app is a dialog-based application and I want to know whether there is an elegant way in Visual C++ 6.0 to capture a mouse click event on a specific dialog item. For example, my current application dialog contains two static text elements called, let's say A and B.
I want my application to do something only when portion B (a static text) of the dialog is clicked.
Right now I do it in a seemingly un-elegant way. I first get the rectangle coordinates of the B portion, and when a mouseclick occurs, the main dialog's OnLButtonDown function will compare the click's coordinates with B's coordinates, and it will do something only when the mouseclick occurs inside B.
Is there a more elegant way to do this? E.g., can I instruct B directly to capture mouseclicks?
Thanks!
|
|
|
|
|
Indrawati wrote:
can I instruct B directly to capture mouseclicks?
Yes, just create B with the SS_NOTIFY style. It will the send it's parent window (your dialog) a STN_CLICKED notification message when a user clicks on it.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
What additional arguments do I need to pass to this constructor so that when the dialog opens up, I want the dlg to be in default folder (C:\temp)
CFileDialog dlg(true, "txt", "*.txt");
Or any methods of CFileDialog, which I can use to set the default folder?
Presently, the default folder is the desktop.
Thanks
|
|
|
|