|
Joan,
Thanks, your reply helps. Just one quick follow up question. What is the best way to get the Destination path from the user? .. Thanks!
Anjum.
|
|
|
|
|
|
BOOL CopyFile(
LPCTSTR lpExistingFileName,
// pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
You will find more info on this in the MSDN Help File. Good luck.
|
|
|
|
|
Hello,
I need to prevent the user to hit "Ctrl+Alt+Del", I've been reading information on this on MSDN and I've find out that a Gina Dll is the right stuff.
The samples are not clear for me and are only a few...
Can I only handle that keystroke message in my gina dll? or I must handle the other kind of stuff since mygina.dll would substitute the msgina.dll?
I've readen that my OS could not start if I miss some things and I'm worried about that, I will use the "test" computer in my enterprise, but I would like to know more about all that facts...
Thank you in advance...
|
|
|
|
|
I'm sorry I can't help you with your problem
But could you please tell me the URL to the MSDN article? I'd like to experiment with the msgina.dll, too.
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I can't remember the link, but I have the files, search "gina" in the msdn, if you can't find it send me an e-mail where I can send you the zipped files.
|
|
|
|
|
|
Strictly, the Secure Attention Sequence isn't handled by the GINA DLL, but it is called in response.
I think what you want to do is to create a shim or pass through GINA, that has a custom wlxLoggedOnSAS, which you then return WLX_SAS_ACTION_NONE from, rather than calling through to the standard GINA.
This would effectively disable Ctrl-Alt-Del, but on a system basis rather than an app basis.
Steve S
[I wrote a custom GINA and survived...]
|
|
|
|
|
Steve S wrote:
Steve S [I wrote a custom GINA and survived...]
I'll call you a Hero!
I keep submitting “VB” as a Priority-1 bug, but apparently no one here knows how to fix it. Nick Hodapp, Semicolon
|
|
|
|
|
OK then, are you telling me that I can make a DLL with a handler to the keystroke Ctrl+Alt+Del without handling anything else and that it should work?
I mean that if I handle the message WLX_SAS_TYPE_CTRL_ALT_DEL will do I need to handle too the other GINA operations? (see below)
-> From the msdn:
If you are writing a GINA to replace the Microsoft standard GINA (MSGINA), you may want to provide some or all of the MSGINA functionality. Following is a list of these features and a brief description of how they are controlled.
The mentioned list talks about handling the automatic logon and some other features related to registry entries, do I need to handle them in order to make them work or they will work automatically for me if I not handle them?
Thanks in advance.
|
|
|
|
|
Please could someone help me?
I have a SQL command which retrieves records no problem.
I can do wildcard searches with every field except my date field. What am I doing wrong?
Can someone give me some ideas or sample code.
Thankyou very much!
|
|
|
|
|
I have a project coming up that will require me to use sockets (or so I belive as I'll be needing to do some TCP/IP "stuff"). Anyhow, my question is can I use sockets to communicate with the serial port? I have yet another serial comm project to do before the socket one and thought maybe I'd get my feet wet with that. I've not had a chance to do any reading up on this subject yet and just would like to know if it can be done.
-Mel
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
|
|
|
|
|
Who told you the serial port uses the TCP/IP protocol ? Bury him.
Back to real work : D-25.
|
|
|
|
|
no no no.... I have another app to develop using the serial port and thought I could wet my feet with sockets writting it... just didn't know if sockets allow access to the serial port (still haven't read anything yet).
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler
|
|
|
|
|
If I understand your question, you want to know if you can use sockets to communicate via the serial port. This depends on the serial connection.
Sockets let you communicate using TCP/IP. You can use TCP/IP over a serial connection (look up the SLIP and PPP protocols), but that requires that both ends of the connection use TCP/IP.
<assume_Windows_environment>
If you just need to send and receive arbitrary data via the serial port, then you have to use the builtin serial stuff: CreateFile() to open the port, ReadFile() and WriteFile() to read and write data, and so on.
</assume_Windows_environment>
Software Zen: delete this;
|
|
|
|
|
okay... that was what I wanted to know. I still haven't read up on sockets yet but sounds like its going to handle the TCP/IP well since you've implied it to be the default. That is a seperate issue from you question though... thanks for the response
Peace
-Mel
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
- Just remember when you point a finger at someone else, you are only one finger away from making a fist to hit them with!
If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler <
|
|
|
|
|
hello,
i need a tip.
can somebody please tell me how can i include multilanguage support in my VC++ project? I need some of Serbian/Slovenian/Croatian characters to be recognized in Edit and List boxes as in these languages.
|
|
|
|
|
A simple way to manage it is to create as many .rc resource files as there are cultures. For instance appresources_slovenian.rc, appresources_croatian.rc, appresources_serbian.rc.
Then create as many build configurations so you have (Debug Serbian, Debug Slovenian, Debug Croatian, Release Serbian, Release Slovenian, Release Croatian). Each configuration will reference the appropriate .rc file.
Back to real work : D-25.
|
|
|
|
|
or, if you don't want to generate x number of applications, you can generate a DLL containing the resources and load it when the application starts.
You will then have another project only containing the different resources. I usually use one workspace containing all the projects files ( DSP ), one per language.
Max.
|
|
|
|
|
Thanks. Got that,but i am afraid that i was not very precise:my list and edit controls doesn't recognize local characters which are different from english:i can't for example to enter my real name in edit box 'cause it wont be recognized.It should be something like this:
Nikola Radovanović Mlađi
but it is not.Special letters are not recognized.
I think that i do not have appropriate dll file for serbian/slovenian/croatian language,and i dont know where to find it.maybe You know?
thanks.
|
|
|
|
|
- regarding the operating system, of course you must install the appropriate language. From what I know, both of the 3 languages you mention ar enot SBCS, but MBCS instead.
- if you are using the MFC dlls, be sure to use the appropriate mfcxxxloc.dll (where are the localized strings using by the MFC controls).
- and of course, you need to compile your code with the _MBCS switch (multi-byte).
Back to real work : D-25.
|
|
|
|
|
i was reading an article on ADO... and i have two questions about the code:
QUESTION 1:
_ConnectionPtr conptr(__uuidof(Connection));
I searched thru the code, and I cant find "Connection"...
why do we need a "connection pointer object" as opposed to a "connection object"
QUESTION 2:
ATL COM and ADO
--------------------------------------------------------------------------------
This article was contributed by Amit Dey.
Recently I did a project on online banking at NIIT, Bangalore. The project was coded mostly using VB with few ATL components thrown in, if only to teach us programming distributed applications. One middle tier component that I programmed was built with ATL and uses ADO to query the backend (SQL Server). Parts of that code appears here.
I assume the reader knows or at least has a fair idea about COM programming using ATL as well as ADO programming with VB.
What is ADO?
ADO standa for ActiveX Data Object.ADO provides an object-oriented programming interface for accessing a data source using the OLEDB data provider. It is the succesor to DAO and RDO object models and combines the best features DAO and RDO.
Programming OLEDB in C++ is easy. However, for languages like Visual Basic, that do not support pointers and other C++ features, implementing OLEDB is difficult.
This is where ADO really shines. ADO is an high level interface to OLEDB that is based on COM interfaces. Thus any application that supports COM can implement ADO.
ADO Features
Allows acess to all types of data
Supports free threading
Supports asynchronous queries
Supports client-side and server-side cursors
Supports disconnected recordsets
ADO Architecture
In the ADO model, we'll be using three main types of objects-
Connection
Command
Recordset
The Connection object sets up a connection to the data source. First, the data source name, its location, user ID, password etc is stored in a ConnectionString object, which is passed to the Connection object.to establish a connection to the data source.
The Command object is used to execute SQL commands, queries and stored procedures.
When a query is executed, it returns results that are stored in the Recordset object. Data in a recordset can be manipulated and then updated to the database.
Using ADO
First, we'll be building an ATL DLL component. This component has a method that takes one input parameter (customer ID in the project) and returns a reference to the corresponding Recordset object to the VB client. The client then displays the data in a form.
To create the DLL, use the ATL COM AppWizard to generate the framework for the application. Name the project FindCust and choose the server type as Dynamic Link Library.Also choose the option to support MFC library.
Insert a New ATL Object of type Simple Object to the project. Use the name Search in the Short Name textbox of the ATL Object Wizard Properties and click OK to add the object.
In classview, right click the interface name and add a method. Name the method SearchCust and type the following in the Parameters textbox :
[in] BSTR bstrcustid,[out,retval] _Recordset **ptr
Click the OK button to add the method.
Since the SearchCust method returns a reference to a Recordset object, we need to import the ADO library. To do this, open the file, StdAfx.h and add the following code :
#import "C:\Program Files\Common Files\System\ADO\MSADO15.DLL" rename_namespace("ADOCust") rename("EOF","EndOfFile")
using namespace ADOCust;
This step will help the Visual C++ compiler to understand the ADO objects defined in the type library, MSADO15.DLL. The rename_namespace function renames the namespace into which the DLL has been imported to the specified name. The rename option has been used to rename the EOF keyword to EndOfFile, because EOF is already defined in the standard header files.
Also the .idl file contains the method SearchCust which returns a reference to a Recordset object. To make the MIDL compiler understand the ADO objects, import the type library in the .idl file using the importlib statement in the library section (after importlib "stdole2.tlb") like :
importlib("C:\Program Files\Common Files\System\ADO\MSADO15.DLL");
Also move the interface definition in the .idl file to just after the importlib statement to make the MIDL compiler.understand ADO objects.
To do that, cut the interface definition block and paste it after the imporlib statement that was added. My interface definition block looks like:
[
object,
uuid(EB78D558-E071-4D25-80DD-41FD3519934E),
dual,
helpstring("ISearch Interface"),
pointer_default(unique)
]
interface ISearch : IDispatch
{
[id(1), helpstring("method SearchCust")]
HRESULT SearchCust([in] BSTR rcustid,
[out,retval] _Recordset **ptr);
};
Building the ATL Component
Now we are ready to code the SearchCust method to retrieve the corresponding information.What we need to do is :
Initialize the COM library
connect to the data source
execute the SQL commands
return the Recordset object
Uninitialize the COM library
Initialize the COM library :
CoInitialize(NULL);
To connect to a data source, first declare a Connection object pointer by passing the ID of the coclass.
_ConnectionPtr conptr(__uuidof(Connection));
Now call the Open function to establish a connection to the data source.
conptr->Open(_T("Provider=SQLOLEDB.1;
Data Source=SQLServer;
Initial Catalog=Customer"),
_T("user1"),
_T(""),
adOpenUnspecified);
but dont u have to specify a "database" name in addition to "Customer" table?
QUESTION: It's using SQL server based security. what about NT based login?
Thanks
norm
|
|
|
|
|
i was reading an article on ADO... and i have two questions about the code:
QUESTION 1:
_ConnectionPtr conptr(__uuidof(Connection));
I searched thru the code, and I cant find "Connection"...
why do we need a "connection pointer object" as opposed to a "connection object"
QUESTION 2:
conptr->Open(_T("Provider=SQLOLEDB.1;
Data Source=SQLServer;
Initial Catalog=Customer"),
_T("user1"),
_T(""),
adOpenUnspecified);
but dont u have to specify a "database" name in addition to "Customer" table?
QUESTION: It's using SQL server based security. what about NT based login?
Thanks
norm
norm
|
|
|
|
|
norm wrote:
but dont u have to specify a "database" name in addition to "Customer" table?
It's a smart pointer to a COM object, it's easy to create, with the __uuidof stuff, and it free's itself.
norm wrote:
why do we need a "connection pointer object" as opposed to a "connection object"
I *believe* that a username/password combination can be associated with only one database, therefore it selects it for you.
norm wrote:
It's using SQL server based security. what about NT based login?
How do you mean ? Once two machines are online and able to see each other, no login is necessarily required between them. Therefore the database has it's own security also, so it can validate users itself.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
<quote>
norm wrote:
It's using SQL server based security. what about NT based login?
How do you mean ? Once two machines are online and able to see each other, no login is necessarily required between them. Therefore the database has it's own security also, so it can validate users itself.
<end quote="">
there's two type of account that u can create with SQL server:
1. SQL server account (user name + passwd combination: transmitted in plain text over the wire)
2. NT based authentication (SQL grant access to a user based on the session/NT login: better security)
and with option 2: NT based authetication, u dont need to send passwd as Open argument. But format? how exactly do u call Open method with NT based login?
norm
|
|
|
|
|