|
I think your starting point should be learning how to use the debugger, rather than copying low-level code off the internet and then asking other people to explain it to you.
|
|
|
|
|
It's recommended that you not put your email address in the message. No one is going to emil you an answer - you'll have to read the forum to see if there is any help.
As suggested, use the debugger and find out where the error is occurring. Once you know that, then you see how to fix it.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Yeah... what the other two people said...
Just out of curiosity though, why don't you just use a combination of the OnKeyPress, OnKeyUp and OnKeyDown events to handle what you need to do rather than the schlep of hooking into the keyboard?
Also, remember to propogate meaningful error messages rather than just a one liner that won't tell you what the actual problem is. Use the GetLastError function (in the Windows.pas unit if I'm not mistaken) at the very least to see exactly what went wrong.
Hope this helps you a little
Cheers,
Glen Vlotman
QFTD: "You cannot code around stupidity..."
|
|
|
|
|
To: 1102043058@qq.com
To: Mr. #6352956 at CodeProject:
I was wondering if you're still doing anything with that .DLL code you had up on the Delphi forum at CodeProject.
I looked at it, and was trying to figure out whether there might be a thread-access problem (even a security block) that kept the hook from being set. I would have called GetLastError to find out why SetWindowsHookEx returned null.
Did you ever do that? I'm curious to know what you found out if you did.
In case you didn't get around to it, you can look up the parameter info on MSDN, which will tell you the same thing Delphi's documentation should have. (I haven't looked at it yet to see what it says about SetWindowsHookEx.)
Here are the links:
GetLastError function:
http://msdn.microsoft.com/en-us/library/ms679360
SetWindowsHookEx function:
http://msdn.microsoft.com/en-us/library/ms644990
GAMerritt
01-18-11
|
|
|
|
|
Hi everyone,
I have a C# COM dll which I've add to my delphi application . I can access to its methods and properties successfully .but I cannot access to its events .
this is the sample C# code that I found and used:
[ComVisible(false)]
public delegate void CallArrived(object sender, string callData);
/// <summary>
/// Interface to expose SimpleAgent events to COM
/// </summary>
[ComVisible(true)]
[GuidAttribute("1FFBFF09-3AF0-4F06-998D-7F4B6CB978DD")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface IAgentEvents
{
///<summary>
/// Handles incoming calls from the predictive manager.
///</summary>
///<param name="sender">The class that initiated this event</param>
///<param name="callData">The data associated with the incoming call.</param>
[DispId(1)]
void OnCallArrived(object sender, string callData);
}
/// <summary>
/// Represents the agent side of the system. This is usually related to UI interactions.
/// </summary>
[ComVisible(true)]
[GuidAttribute("EF00685F-1C14-4D05-9EFA-538B3137D86C")]
[ClassInterface(ClassInterfaceType.None)]
[ComSourceInterfaces(typeof(IAgentEvents))]
public class SimpleAgent
{
/// <summary>
/// Occurs when a call arrives.
/// </summary>
public event CallArrived OnCallArrived;
public SimpleAgent() {}
public string AgentName { get; set; }
public string CurrentPhoneNumber { get; set; }
public void FireOffCall()
{
if (OnCallArrived != null)
{
OnCallArrived(this, "555-123-4567");
}
}
}
and this is the Delphi Sample code which I used :
procedure TForm1.Button1Click(Sender: TObject);
var
intrf : SimpleAgent;
begin
intrf.AgentName ('Name');
end;
I'll appreciate it if anyone could show me the way to access the Event .
Best Regards,
Shialn
|
|
|
|
|
First you need to create a procedure to handle the event, with the same signature as the delegate e.g.
procedure CallArrivedHandler(Sender TObject, Message string)
begin
//Your event handling code
end
Then you need to point your CallArrived member at the procedure...
CallArrived := CallArivedHandler;
And that should do it. (Apologies for syntax errors - from memory, and I haven't Delphi'd for a few years)
|
|
|
|
|
Hi All,
I have created one DLL having some functions as follows..
I want to call them from VB.net and C#.net.
1) Function CONVERTPWDATA ( PASS1,PASS2 : INTEGER; IpStr : PWord; OpStr : PChar;
LangName : LongInt; AFontType, BFontType : LongInt ) : PChar; StdCall;export;
2) Function CONVERTDATAEX ( PASS1,PASS2 : INTEGER; IpStr : PChar; OpStr : PWord;
LangName : LongInt; AFontType, BFontType : LongInt ) : PChar; StdCall;export;
Can anyone help me for Compatible Data types in .net for Delphi Data Types.
My Second Question IS
<br />
How to pass Unicode Data from .net and How to receive it back from Delphi DLL.<br />
Thanks in Advance..
I have never failed,I just found 1000 ways that never works.
Regards,
Victory.
|
|
|
|
|
Here is a site I used when doing the same thing. Everything worked perfect for me.
http://www.netcoole.com/delphi2cs/datatype.htm
In regards to your Unicode question, I'm have no experience, so I can't comment.
Hope the chart helps.
|
|
|
|
|
I want to search the record by a word which is Unicode.
So I can give it in SQL Mgnt Studio like this..
select VocNo from VocableMaster where VocDescSan like N'अपाप'
It can give me result.where 'N' denotes it is Unicode string.
But I cant send it via Delphi.
I tried following ways :-
<code>1> select VocNo from VocableMaster where VocDescSan like N'''+reVocSan.Text+'''
</code>
then it gives me no result becoz reVocSan.Text will be '????'(due to unicode)
<code>
2>select VocNo from VocableMaster where VocDescSan like N:VocDescSan)) and ');
Parameters.ParamByName('VocDescSan').DataType := ftWideString;
Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;</code>
then it will give error about VocDescSan parameter not found. bcoz it combines both N and para.
3>select VocNo from VocableMaster where VocDescSan like N :VocDescSan)) and ');
Parameters.ParamByName('VocDescSan').DataType := ftWideString;
Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will give error about Column Name not found for 'N' (if space between N and para)
4>select VocNo from VocableMaster where VocDescSan like N+:VocDescSan)) and ');
Parameters.ParamByName('VocDescSan').DataType := ftWideString;
Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;
then it will give error about Column Name not found for 'N'
<code>5>select VocNo from VocableMaster where VocDescSan like :VocDescSan)) and ');
Parameters.ParamByName('VocDescSan').DataType := ftWideString;
Parameters.ParamByName('VocDescSan').Value := reVocSan.Text;</code>
then it will not give any error. but couldnt give any Result.
I will check it in SQL mgnt Studio.
select VocNo from VocableMaster where VocDescSan like 'अपाप'
Can anyone have solution for this..
I have never failed,I just found 1000 ways that never works.
Regards,
Victory.
|
|
|
|
|
Hi,
Have you check that your application is set to Unicode/UCS4 encoding?
Cheers,
Glen Vlotman
"You cannot code for stupidity"
|
|
|
|
|
PLEASE NOTE: if this post needs to be posted elsewhere, please let me know,
as Delphi seemed like the nearesr Pascal related forum. Thanks.
ORIGINAL POST:
Hi
I'm having difficulties using FreeDOS Scandisk,
possibly because I'm not quite sure as to how to
set up my hard drive format.
1. The PC's specs I was using to compile were:
- A doubly partitioned hard drive, where C: had
all system on it as a primary and active FAT32
partition, and where D: was a logical FAT32
- Borland Turbo Pascal 7.0
- The two files compiled correctly and produced an .EXE file
- I booted the PC via some BootCD with Win98 system files
and attempted to run FreeDOS Scandisk on pure MSDOS mode
2. The things I wasn't sure about were:
- FreeDOS Scandisk appeared to report some of my C: and
later D: information correctly, but also claimed there
was some boot area read errors.
- When FreeDOS Scandisk tried to do a surface scan,
it would report a non-DOS disk for either C: or D:
so that no scan was done.
Any ideas on how to fix the above?
Thanks in advance
LL
|
|
|
|
|
Fat32 and Win98 are old technology, I doubt that any support still exists for either. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hi
Well, I guess you'll be surprised to know, but there are
still people and oddly enough even whole companies that
deal with that stuff.
For example, FreeDOS latest update is from only couple of
days ago:
Another example, there's this company called Symantec
(I don't know if you've heard of them) who make one
specific software program that supports FAT32, even
in this day and age - it's called Norton Ghost:
One would imagine that this stuff has been made because there may
still a demand for it.
|
|
|
|
|
FreeDOS Link:
freedos.org
Norton Ghost 15 Link:
shop.symantecstore.com/store/symnahho/en_US/DisplayProductDetailsPage/ThemeID.106300/productID.166539400?resid=S50aXwoHAiwAACOFHWMAAAAH&rests=1268587103046
|
|
|
|
|
Hi Experts,
I m using SQL Server 2005. I have some queries..PLEASE HELP
I m using following Connection String
strConnect = _T("Provider=sqloledb;Data Source=MyServerName;"
"Initial Catalog=MyDatabaseName;"
"User Id=MyUsername;Password=MyPassword;");
<br />
My Queries are :
1> What is the Actual use of "Provider"??
2> What is the difference between "Provider" and "Driver"??
3> I can connect to Database with using Provider or Driver. By using only "Data Source/ Server" and other parameters then Why to use Provider or Driver?
4> IF I Different Provider like 'SQL Native Client' then Can this increase my SQL Server Connection performance??
Please HELP.. ITs Urgent for Me..I have never failed,I just found 1000 ways that never works.
Regards,
Victory.
|
|
|
|
|
A list of providers[^] can be found here[^].
As you see, both ODBC and OleDb are providers. You can connect to SQL Server using these providers because they speak SQL Servers' dialect. These two providers are "generic", and they can handle multiple database-formats.
The native SQL Client provider was written specific for SQL Server. Yes, this should be somewhat faster I are Troll
|
|
|
|
|
Hi Experts...
I am developing a Database application using Delphi 6 using SQL Server 2005 as backend.
Its a working Live project now at my customer end.
But Now the SQL Server getting slow as the Database and its Log file size increases. It becomes very critical situation that the customer some times feels like Server gets Hang and they Restart them. After Restart it will again works fine.
I dont realize the actual problem..Can you Help me out..Its very Urgent.
<br />
My server configuaration is :<br />
Xeon Quad Processor<br />
8 Gb RAM<br />
1 TB HDD<br />
and total 30 CLients are accesing the data as well as Updating the Database.
PLEASE PLEASE PLEASE HELP ME.....
I have never failed,I just found 1000 ways that never works.
Regards,
Victory.
|
|
|
|
|
Unfortunately, this is a huge issue to try to tackle on a forum. To adequately diagnose, I'd need to review your entire application. Unless your willing to contract for my services, that will not be possible here.
Other than that, you might look to see how your handling your db connections - make sure they are all being closed after use. Another possibility is that you are locking db resources which make it impossible for other users to access at the same time. Rebooting the database, while not the recommended solutions, would free up both of these conditions.
Just a few things to look into.
Hope this helps.
|
|
|
|
|
Thankx Stryder_1...
I already checked it..and..
By the way.. as soon as the command gets executed and result get back.
If I close the connection every time then for new command I think it will take some time to reopen the connection.
If the command object is a local then after the Procedure is exited the command object will be free..then connection will also get Reset???
please correct me....I have never failed,I just found 1000 ways that never works.
Regards,
Victory.
|
|
|
|
|
Stryder_1 is quite right - this is too-big an issue to get a simple answer to. However, a good place to start may be with SQL Server Profiler (on the Tools menu of you Management Studio). Use this to set up a trace and identify what's happening when things are starting to go wrong.
Two other (easy) things to check are: In your code, make sure you aren't opening new connections all over the place (the trace will tell you this) and, if you have stored procedures, make sure you are deallocating cursors correctly.
Good luck!
|
|
|
|
|
hi dan_fish,
I have checked it on SQL profiler..
But I dont understand it. I found some procedures get executed at background and some of my queries take time (apporx 123455), whats does it mean??
Is it take more time than expected?
then what should I do??
Please help me.
<br />
I will check in my Source code..<br />
and all the queries having Select * will replaced with only needed Column name.<br />
Will it do anything to performance??? I have never failed,I just found 1000 ways that never works.
Regards,
Victory.
|
|
|
|
|
Hi Vijay
vijay.victory wrote: some of my queries take time
then what should I do??
Identify where the queries are coming from in your code, then run them in Management Studio and take it from there. Right-clicking in the query pane and selecting 'Display Estimated Execution Plan' may be of help in identifying where your problem lies.
vijay.victory wrote: Is it take more time than expected?
I can't tell you that - it's your database and code, so only you can know.
vijay.victory wrote: all the queries having Select * will replaced with only needed Column name.
That's a good idea - you should always do that anyway because it reduces network traffic, but your problem here is the time of execution, not the time of retrieval.
Cheers,
Dan
|
|
|
|
|
Hi all,
I have been looking for a component for Delphi 7 (enterprise edition), which will allow me to do the following:
1) Decrypt specific encrypted nodes in an XML file to a stream.
2) Validate specific nodes against specific schemas (typically this will be the decrypted nodes, which will have their contents described in a encrypted schema)
3) Parse large XML files (several hundreds MB's).
Unfortunately, I have not found any components that are capable of this.
Does anyone know of a component which will allow me to do the above?
Kind regards,
Arthur de Beaumont
|
|
|
|
|
I think you'll struggle to find a single component to do all that for you.
When it comes to de/encryption in Delphi, it's hard to beat dcpcrypt
As for your xml documents, just use the classes and interfaces available to you in the XMLDoc, XMLIntf, XMLDOM units. They give you TXMLDocument and IXMLNode, which is all you really need to load up a file and parse its nodes.
|
|
|
|
|
You can try NativeXML[^].
abeaumont wrote: Decrypt specific encrypted nodes in an XML file to a stream.
There is no real way of getting around this, however if I am not mistaken this class allows for events to fire when reading a node/attribute.
abeaumont wrote: Validate specific nodes against specific schemas (typically this will be the decrypted nodes, which will have their contents described in a encrypted schema)
I haven't needed to use this feature for the component in question, but I suppose fiddling around with that shouldn't be too much of a problem, even if you have to do your manipulation via the component, then use the XML DOM to load the schema.
abeaumont wrote: Parse large XML files (several hundreds MB's).
This would probably be more a case of the machine that the application will be running on and the efficiency of the XML traversal algorithm that the component uses. However, you must remember that traversing XML documents in itself tends to take longer based on the depth of the nodes. Expect delays in the region of something like:
TimeToLoad = ((XMLFileSize)^NodeDepth)/TraversalEfficiencyOfComponent
... or something to that effect. NOTE: This is a thumbsuck at best, but you will see what I basically mean when you load large XML files.
A plus of this component/class is the fact that it does not use the XML DOM at all... AND it is free... which to me is always a bonus .
Hope this helps
Cheers,
Glen Vlotman
QFTD: "You cannot code for stupidity."
|
|
|
|