123 ERROR_INVALID_NAME after activate Wave audio liverecorder - delphi

I am using the wave audio component in my project and I run into a problem that I am unable to resolve.
I am using Delphi XE 5 and my operating system is Windows 8. When I am trying to the run the project and active the liveaudio recorder on Windows 7, I got this: error Exception EOSError in module Chatproject.exe at 00029633. System Error. Code: 123. The filename, directory name, or volume label syntax is incorrect. But its working normal on Windows 8,. I tried to debug and figure out the problem I got this error message when I am activating the recorder
Update of the question :
i debugged each of sendtocl , sendbuffer ,buffer^, buffersize and here is result in the image ,, but i have no idea how to fix sendbuffer and buffer^ and sendtocl
http://i.stack.imgur.com/5sZ05.jpg

You have four references to sendtocl:
#56: sendtocl: TIdUDPClient;
#235: if sendtocl.active then
#236: sendtocl.SendBuffer(RawToBytes(Buffer^, Buffersize))
#260: sendtocl.Broadcast(usertype.Text, 12000);
It should be getting created when the form is created, assuming it's a component dropped on the form. But for whatever reason, it isn't instantiated at some point.
This is consistent with the exception message you're getting.
The ERROR_INVALID_NAME is probably pointing to an invalid URI, path, or filename -- it's entirely possible that it's valid in Win 8 but not Win 7. So when you try to invoke .Active, it fails. But why sendtocl woudl be set to NIL doesn't make sense. Mabye the exception is on the SendBuffer method?
As Ken suggests, you just need to go in with the debugger and figure out what's going on. I'm not sure there's much more us "out here" can do for you other than comment on how the code appears.

Related

G1ANT Studio Advance Course Lesson 8 Error

Error Image occuring in advance course Lesson 8:
Code used is
program mtsc
♥rdc = /ui[#name='Remote Desktop Connection']
waitfor.ui ‴♥rdc/ui[#id='5017']/ui[#name='Show Options ']‴
ui.click ‴♥rdc/ui[#id='5017']/ui[#name='Show Options ']‴
ui.settext ‴♥rdc/ui[#typeid='50003']/ui[#typeid='50004']‴ text test.domain.com
delay 1
ui.settext ‴♥rdc/ui[#id='13064']‴ text admin
When I am executing program their is error occuring at 4th line of code i.e. "
Exception of type FlaUI.Core.Exceptions.ElementNotAvailableException'
was thrown" kindly give solution on this error.
Use the wpath address of the combox and paste it in the code instead of "rdc/ui[#typeid='50003']/ui[#typeid='50004".
And don't use rdc in front of that wpath, it will run the code.
You can refer my assignment video. I have shown in that how can we remove this error.

Getting Delphi to read a database with a new version of Microsoft Access

We use a Delphi 10 programme that reads in an Access database. I do not deeply understand how it does it, except that I believe it uses units called DAO.pas and DAO_TLB.pas.
I recently upgraded from Office 2007 to Office 2016, and since then the Delphi programme is unable to read from the database; it gives the error:
Project MyProj.exe raised exception class EOleSysError with message 'Class not registered'.
I have tried to search to find how to fix this but am struggling because I don't really understand what's going on under the hood. I tried to install the Access 2016 type library, but that didn't seem to make any difference.
Extremely grateful for any help.
Thanks,
Tom
EDIT: DAO.pas is here. DAO_TLB.pas is where the error is triggered; the function which errors is:
class function CoDBEngine.Create: _DBEngine;
begin
Result := CreateComObject(CLASS_DBEngine) as _DBEngine;
end;
Where CLASS_DBEngine is a constant declared as:
CLASS_DBEngine: TGUID = '{CD7791B9-43FD-42C5-AE42-8DD2811F0419}';
I have also just noticed that, when the error occurs, if I click continue rather than break, a new error appears, saying:
Class not registered, ClassID: {CD7791B9-43FD-42C5-AE42-8DD2811F0419}
i.e. the ClassID is the CLASS_DBEngine constant.

Fast Report fr3 File loading Error in Delphi

I have question about loading *.fr3 in DelphiXE5,
I designed a report and pointed some text to Memo inside of Fast Report everything was ok until I want to load fast Report file from out site App it works for my PC perfectly but when I install client side it gets Error like this Photo include in this message
And the code I used is:
begin
frxReport1.LoadFromFile(ExtractFilePath(Application.ExeName)+'R1.fr3');
frxReport1.PrepareReport();
frxReport1.ShowReport();
end;
Error message:
'18/89765' is not a valid floatin point value
'238/11039' is not a valid floatin point value
'275/90569' is not a valid floatin point value
'41984/5614698264' is not a valid floatin point value
'41984/5618072454' is not a valid floatin point value
'94/48825' is not a valid floatin point value
I found the problem, the problem was Microsoft windows 8.1
I'm using Microsoft Windows 8.1, Delphi Xe 5 and Fast-report 4.15.6
First I made a report in fast report without any change and then run my app in windows 7 save as Fast-report to file and then use in all version of Microsoft Windows, thanks a lot
The problem has been originated form Regional Settings.
Win 8.1 automatically changes decimal separator as '.' to '/' in Persian language, even in fast reports.
The Microsoft has to figure this problem out.
step 1: open frxutils.pas from fastreport lib
step 2: function frxStrToFloat(s: String): Extended;
step 3: relapse this code: [',', '.']) with [',', '.','/']

How do I avoid the debugger stopping my program when browsing a non-image in a TOpenPictureDialog?

I'm using a TOpenPictureDialog to browse for images. In debug mode, when I'm browsing in this dialog for a picture and I happen to click (not double click) on a shortcut (.lnk), the debugger interrupts my program because it catches an exception, saying it's not a valid file format.
How to overcome this? I know it's only in debug time and don't have any issue in the final EXE, but it is getting very annoying, because I'd like to be able to go through these shortcuts.
You are out of luck here, this bug was reported in the QC 69533 and was fixed in the update 3 of Delphi 2009.
The code used to by the VCL to verify if a file is valid image, doesn't check for the shortcuts files (.lnk) so the VCL thinks which the file is a valid image and try to load the file and then raises a EInvalidGraphic exception.
The exception is only raised in the debugger because a code like this is used to check the validate the filename.
(Only showing part of the real code because is VCL code)
ValidPicture := FileExists(FullName) and ValidFile(FullName);
if ValidPicture then
try
// here try to load the file even if is a shortcut(.lnk)
except //this exception is caught by the debugger.
ValidPicture := False;
end;
Workarounds
1) You can add the EInvalidGraphic exception, to the exceptions list to ignore list.
2) you can write a detour (here you have a sample) and implement your own TOpenPictureDialog.DoSelectionChange method (validating the .lnk files), because is here where is made the validation of the files to load.
3) you can override the DoSelectionChange method of the TOpenPictureDialog using a interposer class, to validate the files to load.
TOpenPictureDialog= class (ExtDlgs.TOpenPictureDialog)
procedure DoSelectionChange; override;
end;

Reconcile Error: Has anyone had problems with truncated error messages?

I'm here again to ask for a help to you. This time I believe that few will respond given the great particularity of the problem which I will relate. I'm starting in the world of DataSnap, and still have things I do not understand how this error I will relate.
My Delphi is XE (version 1, Update1). I am using Postgres which generates error messages in Portuguese (Portuguese Brazil) and for this reason the error messages have accents. The connection components are ZeosLib package.
I am using a dialog box "reconcile error" to display errors arising from the application of updates and to test, I tried to insert a record that already existed, thus violating a unique key and thus displaying the reconcile error dialog.
In the memo of the dialog, the message that appears is truncated, ie cut. Check it out:
ERRO: duplicar valor da chave viola a restrição de unicidade "uc_usu_va_login"
DETAIL: Chave (va_login)=(admin) já existe.
CONTEXT: comando SQL "INSERT INTO USUARIOS (VA_NOME
,VA_LOGIN
,CH
But actually what should be returned is this:
ERRO: duplicar valor da chave viola a restrição de unicidade "uc_usu_va_login"
DETAIL: Chave (va_login)=(admin) já existe.
CONTEXT: comando SQL "INSERT INTO USUARIOS (VA_NOME
,VA_LOGIN
,CH_SENHA
,VA_EMAIL)
VALUES (pVA_NOME
,pVA_LOGIN
,pCH_SENHA
,pVA_EMAIL)"
PL/pgSQL function "idu_usuarios" line 7 at comando SQL
I have done a debug on the server to see if the problem is ZeosLib, but I found that the error message generated on the server is complete, proving that ZeosLib does not truncate the message. Everything is unicode. All strings are WideString (the default) on both my program and in ZeosLib.
As you know, to be thrown on the server, the exception is forwarded to the client, roughly speaking, by DataSnap, and on the client, the Reconcile method of TClientDataSet verify if there were problems and then throw the famous exception EReconcileError that can be handled in the OnReconcileError event of TClientDataSet, therefore I believe that the message is being truncated by DataSnap.
On the client I debug the Reconcile method (DBClient.pas) and immediately before the exception is thrown the flow enters a function within a cpp source code that I think part of the library midas.dll, MidasLib.obj more specifically, since I am using this strategy, not to have to distribute the DLL with my application.
Check(FDSBase.Reconcile_MD(FReconcileDataSet.FDSBase, FDeltaPacket, VarToDataPacket(Results), Integer(Self), RCB));
This call is done at line 1952 of the unit DBClient.pas on Delphi XE Update1. Pressing F7, the debugger enters a source C++ (cpp), so I believe it is within the midaslib.obj. How I do not understand C++ well, I press Shift-F8 to exit the current method and return the next instruction, that is already inside the event OnReconcileError!! Therefore, the truncation must be done within the function I mentioned, within a cpp source, within midaslib.
My intention is to make the Reconcile Error dialog a tool not only for the final user but to support personals, providing separately information of Error, Details and Context. This helps a lot to discover a problem.
The problem now is to make the message appear in full. Has anyone had this kind of problem with messages being truncated by midas?
Also another point DSClient.pas I could extract the error message as it is passed to the exception:
'Erro SQL: ERRO: duplicar valor da chave viola a restrição de unicidade "uc_usu_va_login"'#$A'DETAIL: Chave (va_login)=(admin) já existe.'#$A'CONTEXT: comando SQL "INSERT INTO USUARIOS (VA_NOME'#$A' ,VA_LOGIN'#$A' ,CH'
If you remove the quotes and replace #$A (1 character) by a white space (one character), you will see that the string has exactly 255 characters!!
I also discovered that the "GetErrorString" in dspickle.cpp uses the constant DBIMAXMSGLEN which is defined in bdetypes.h as 127 (half of 255). As we are in the world of Unicode, it would not be a question of increasing this value to 255 in order to have two bytes per character? This is only a guess...
I leave the question in the air because I lack the knowledge to understand C++ :) Who can help, just look at the function implementation "GetErrorString" in dspickle.cpp. There is this:
LoadString((HINSTANCE)hDll, iErrCode, pString, DBIMAXMSGLEN)
pString is the error message and DBIMAXMSGLEN = 127.
Contradicting the opinion of others I decided to tweak further and finally figured out how to increase the number of characters in the "Reconcile" error message. As I thought the problem was in midas.dll, or more specifically the sources that make up the midas dll because the same set of sources can create MidasLib, which does not require a midas dll. To resolve I had to install the Delphi C++ personality to compile the midas.
After finding the line of the error, I discovered that there is even a request for repairs to the QC (http://qc.embarcadero.com/wc/qcmain.aspx?d=84960) which seems to have been ignored by the staff of Embarcadero, as that the "Resolution" as is "Deferred to Next Rel" (Deferred to Next Release) but the request is from 2010 and I'm using Delphi XE which in my opinion should have the solution but here I am correcting by myself ;)
The problem is inside the method "Clone" of the "DSBASE" class, inside source "ds.cpp" at line 2133 (Delphi XE, Update1). Below is the code block. The red line is the problematic line:
// Set the third field for the error string.
LdStrCpy((pCHAR)pFldDes->szName, szdsERRMESSAGE);
pFldDes->iFldType = fldZSTRING;
pFldDes->iUnits1 = 255; // Increased on request.. DBIMAXMSGLEN;
pFldDes++;
Note that it is very interesting the problem line. It has a constant value of 255, which limits the size of the error messages and a comment "Increased on request". Also note that next to the comment, there is a constant DBIMAXMSGLEN, which I had found and already suspected as being responsible for the problem, but as it was not being used I changed the value of DBIMAXMSGLEN but the error message always came without changes. It is worth mentioning that there is a semicolon (;) after DBIMAXMSGLEN which leads me to think that before (I do not know when) this line was one that was just after my fix:
pFldDes->iUnits1 = DBIMAXMSGLEN;
It's as if someone had deliberately set the field value to 255, removing the previous implementation that was really dynamic and seemingly more correct. After performing the replacement of the line I increased the value of DBIMAXMSGLEN to 1024. DBIMAXMSGLEN is declared "bdetypes.h" as a define. After correcting the line went like this:
#define DBIMAXMSGLEN 1024 // Max message len
After these two changes in "ds.cpp" and "bdetypes.h" I build, test, and the result was as expected: the error message was presented in full in the Reconcile dialog.
To the brave who want to try if they have seen this problem, you need the sources of MIDAS, which comes with Delphi from 2010 if I remember correctly. Good luck to all.

Resources