|
I suspect my .NET hosting outift is going to decline my request to run a .NET windows service. The service is needed to check some POP3 accounts periodically and respond based on their contents.
Question therefore is this: Is there any way to simulate a 'daemon' using Web Services ? I had this crazy notion of a service posting to itself once it had received an initial (external) wakeup call. Seems a bit grim. Is there a better/alternative approach ? Have I missed something obvious in the .NET framework ?
Thanks
Jerry
|
|
|
|
|
Well, web services weren't designed for this, but you can always create a web method that start a background thread with a timer and do whatever you want in this thread.
Trying to make bits uncopyable is like trying to make water not wet.
-- Bruce Schneier
By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn
|
|
|
|
|
Using VScrollBar in VB.NET program,I found the VScrollBar's Event "Scroll" will be raised twice when I click VScrollBar once. Why?
|
|
|
|
|
CryptUIDlgSelectCertificate is a undocumented API. So I have not read any reference about this API. But I find some similar API in new MS SDK. In cryptuiapi.h of new MS SDK, it define as following:
PCCERT_CONTEXT
WINAPI
CryptUIDlgSelectCertificateFromStore(
IN HCERTSTORE hCertStore,
IN OPTIONAL HWND hwnd, // Defaults to the desktop window
IN OPTIONAL LPCWSTR pwszTitle,
IN OPTIONAL LPCWSTR pwszDisplayString,
IN DWORD dwDontUseColumn,
IN DWORD dwFlags,
IN void *pvReserved
);
So I guess CryptUIDlgSelectCertificateFromStore and CryptUIDlgSelectCertificate have same parameters. And I write some codes to invoke CryptUIDlgSelectCertificate API. But it doesn't work(the program can be compiled, and it runs well, there is no error. But the selectcertificate dialog can not popup ). The following is source code:
if(hStoreHandle = CertOpenStore(
CERT_STORE_PROV_SYSTEM,0,NULL,CERT_SYSTEM_STORE_CURRENT_USER,
L"MY"))
printf("The MY store is open. Continue.\n");
else {
handle_error("The store did not open.");
goto handle_error;
}
HINSTANCE hLib;
typedef PCCERT_CONTEXT (WINAPI *fnDLLProc)(
HCERTSTORE,
HWND, // Defaults to the desktop window
LPCWSTR,
LPCWSTR,
DWORD,
DWORD,
void *
);
fnDLLProc lpfnDLLProc;
//
hLib = LoadLibrary ("cryptui.dll");
if (hLib)
{
lpfnDLLProc = (fnDLLProc) GetProcAddress (hLib, "CryptUIDlgSelectCertificateW");
pCertContext=(*lpfnDLLProc) (hStoreHandle, GetDesktopWindow(),NULL,NULL, 1, 0, 0);
FreeLibrary (hLib);
}
I think I had better know the parameters of this API. Could anybody tell me the parameters of this API, or the errors of my source code.Thanks a lot!
|
|
|
|
|
Hi Friends,
when i call a MSMAPI object from a standalone exe in VB .NET, i am able to send a mail. But when i spawn this exe as a process from a windows service, i get an error message while signing on using the MAPI session SignOn() method. I tried using windows service logon as both local system and using my NT logon too. The error message thrown is
System.Runtime.InteropServices.COMException (0x800A7D1A): Not supported
at MSMAPI.MAPISessionClass.SignOn()
at ProcTryMail.tryMail.Pr_SendMail() in D:\Projects\Ems\Backup_Nov17OutSeq\ProcTryMail\tryMail.vb:line 20
My feeling was that some security access is required.
The code i have used is:
Public Class tryMail
Private objMapiSession As MSMAPI.MAPISession
Private objMapiMsgs As MSMAPI.MAPIMessages
Private i As Boolean
Public Sub Pr_SendMail()
Try
objMapiSession = New MSMAPI.MAPISession()
objMapiMsgs = New MSMAPI.MAPIMessages()
objMapiSession.SignOn()
objMapiMsgs.SessionID = objMapiSession.SessionID
objMapiMsgs.Compose()
objMapiMsgs.RecipDisplayName = "--give some mail id here--"
objMapiMsgs.MsgSubject = "From .NET MAPI"
objMapiMsgs.Send()
objMapiSession.SignOff()
Catch
End Try
End Sub
End class
Will be grateful if anyone of u is able to find out the problem.
Thanks
Alex
|
|
|
|
|
Hi,
I am trying to use the picturebox to display some images. The source images are 16x16 icons and they look fine in designer mode when the picturebox is scaled up to 64x64.
However at runtime, the images get blocky and they appear not to have scaled properly to the new dimensions. I had seen an article on here at one time which outlined this problem but i can't seem to find it.
If anyone has any insite on this issue I would appreciate it.
Regards
Paul
|
|
|
|
|
I recently had the need to stream data to a running application using anonymous pipes. I was very surprised to find it so hard in .NET!
I ended up using the "CreatePipe()" and "CloseHandle()" functions using "DllImport(kernel32.dll)".
Is there really no native support for pipes in the FCL?
|
|
|
|
|
I'm an admitted "pipes" newbie; I've done some reading on named pipes, and that's about it. I think that MS is moving away from named pipes (which might not be the same thing you're talking about).
I'd normally use sockets or something else, but I realize you might not have that luxury. Are you saying that this application you had to interface with is not your own, which dictates the choice of pipes? If so, and there's no direct support, I feel for ya.
Regards,
Jeff Varszegi
|
|
|
|
|
It's actually "anonymous pipes" I'm talking about (e.g., not "named pipes"). When you create an anonymous pipe, you get TWO handles - one you use on your side of the connection, the other you pass to the remote application. The pipe is "anonymous" in that there is no "name" for it - there is no need, as both sender and receiver can access it using the handles that are returned.
The application I'm interfacing with is Microsoft Flight Simulator 2002 (MSFS2k2). There is a facility built in to MSFS2k2 to send it a "Flight Video" by passing it a handle to an open file containing the video. By using an anonymous pipe, I can have one process create and send a video to MSFS2K in real-time. This is what I want to do.
I have it working now, but I sure am surprised if in fact MS.NET doesn't provide support for this - especially as it continues to be a necessary tool for interacting with MS products...
|
|
|
|
|
I have this problem and I don't have any clue:
On a Win2K Advanced Server SP4 with Terminal Server I have installed the .NET Framework 1.1. I created a HelloWorld Console Application and installed it on this server. In the same folder I placed a textfile.
When I log on with a user account the Hello World app won't start. I don't see or hear anything! Not even error messages. I can access the folder and open the textfile. In the taskmanager I don't even see a process being created or something.
When I log on with an admin account it all works just fine!
I really don't know where to look for.
Why create waste if we throw it away, anyway?
|
|
|
|
|
This sounds like a .Net security issue to me.
I had a similar problem running an application from a network drive.
When I did so, it did not work, when I ran it from the local drive, it worked fine.
I don't have any knowledge on the .Net security model yet, but maybe someone can point to a good resource on this, or eplain what could be happening?
Pauwl
|
|
|
|
|
This was a tough search, but this KB article is the solution:
http://support.microsoft.com/default.aspx?scid=kb;en-us;821546
(Especially the part about Creat Global Objects)
grtz en thanx for spending time on this one...
Octavie
---------------------------------------------
Why create waste if we throw it away, anyway?
---------------------------------------------
|
|
|
|
|
Hello!
I want to implement simple COM object which will communicate with Oracle database somewhere on internet. It looks rather simple. But I have a possibility to use either C++ or C# technology. As I do not know C# very well: someone can help and put some comments - which technology would be simpler to write/manage ?
Or maybe there exists some ready-to-use sample?
Thanks for help
|
|
|
|
|
|
Five Steps to Rapid Development with TierDeveloper 3.0
Unlock the power of rapid development when you use TierDeveloper from AlachiSoft in your N-Tier application development. Follow the steps below to quickly design, generate, and deploy a great portion of your real-life N-Tier application.
For free evaluation download please visit
http://www.alachisoft.com/download.htm
STEP 1: HAVE YOUR DATABASE READY
1. Create your database in Microsoft SQL Server, Oracle, or DB2. You can design and create your own database. Or, you can use the sample database provided with TierDeveloper. Or, you can use one of the databases/schemas already provided with your database. They are:
a.Microsoft SQL Server: Northwind database. Just create a new TierDeveloper project against this database.
b.Oracle: DEMO schema with EMP, DEPT, BONUS, SALGRADE, and other tables. Just create a new TierDeveloper project against this schema.
c.DB2: SAMPLE schema provided with DB2. Just create a new TierDeveloper project against this schema.
2. Populate database with data. This would ensure that you have a fully working database ready to be used by a web application.
STEP 2: KNOW YOUR APPLICATION'S DATABASE INTERACTION
1. Identify table-columns your app will access: Before you do anything, you must know which tables and which columns in these tables is your application going to access.
2. Identify transactional operations: Identify where in your application you need to do insert, update, delete, or single-row select operations.
3. Identify queries: Most applications need to retrieve collection of rows from one or more tables in the database. Identify all places where you need to issue queries. These could be single-table queries or could involve complex joins or nested queries.
4. Identify stored procedures to call: If there are any stored procedures that already exist in the database which you need to call, identify them here. These stored procedures should be those that contains complex business rules or other data manipulation logic. Do not manually create stored procedures in the database for transactional operations or for queries that are otherwise handled by TierDeveloper. TierDeveloper can generate stored procedure DDL for you in that situation.
5. Identify bulk updates or deletes: Most applications do not require bulk updates or deletes but some do. If you have any, identify them.
The best way to understand your applications database interaction needs is to understand its behavior from the user's perspective and focus on all the data that needs to be displayed to the user or changed by the user.
STEP 3: CREATE TIERDEVELOPER PROJECT
1. Connect TierDeveloper to your database: TierDeveloper uses OLEDB to connect to your database and reads its schema so it can let you define the mappings of middle-tier objects with tables in the database (based on what you have determined about your application's interaction with your database). Please note that even if you're going to generate Java/J2EE application that will use JDBC to connect to the database, TierDeveloper (the product) will use OLEDB to connect to your database.
2. Define data object mappings to your tables: Wherever you had identified table-columns that your application needs, define data objects mapped to these tables with the appropriate columns selected as data object attributes. You can map a data object to single table or multiple tables. You'll need multi-table data objects for situations where you're trying to issue a multi-table join query that returns data from multiple tables.
3. Specify transactional methods in data objects: Based on what you identified as your application's transactional needs earlier, you should now define those insert, update, delete, and single-row select as methods of your data objects. TierDeveloper lets you do that with point-and-click.
4. Define queries as data object methods: For each query that you identified earlier, define a query method in the appropriate data objects. Remember, a query returns a resultset which get translated into a collection of data objects by TierDeveloper generated code.
5. Define stored procedure calls as data object methods: Wherever you needed to call stored procedures, you need to define data object methods for them. Remember, these stored procedures contain sophisticated business rules. Any stored procedures for transactional operations or queries can be generated by TierDeveloper so you do not have to manually write them in the database.
6. Define bulk update/delete operations as data object methods: Wherever you need to do a bulk update or bulk delete, you'll need to define data object methods for them.
STEP 4: GENERATE AND RUN 50% OF YOUR APPLICATION INSTANTLY
1. Generate data objects: After you have defined all your data objects, you are ready to generate code for them. You can generate data object code in the following format:
a. .NET components
b. Enterprise Java Beans (for BEA WebLogic, IBM WebSphere, Oracle 9iAS, JBoss, and iPlanet)
c. Java Objects (for any JDK based environment including JSP/Servlet engines)
2. Build and deploy data objects generated code: If you machine has the appropriate build environment for your platform, TierDeveloper asks you whether you want to build the generated data objects code. If you say "yes", it creates the following. It also then deploys them to your appropriate environment.
a. .NET assemblies for .NET components. They are deployed through component services.
b. JAR file for Enterprise Java Beans. They are deployed to your J2EE app server
c. JAR file for Java Objects. They are deployed to your J2EE app server or JSP/Servlet engine
3. Generate web application: After you have generated and build the data objects, you can generate a fully working web application. The purpose of this web application is to let you test all the functions of data objects. This also serves as a good sample/example code for you to copy into your own web application development. TierDeveloper generates the following types of web applications:
a. ASP.NET pages in C# or VB.NET and with or without XML/XSLT.
b. JSP pages to call Enterprise Java Beans.
c. JSP pages to call Java Objects.
4. Build and deploy web application: TierDeveloper can also build the web pages for you. It does the following for each platform:
a. Build a .NET assembly for ASP.NET pages. They are deployed to IIS
b. Build a WAR file for JSP pages. They are deployed to J2EE app server or JSP/Servlet engine
5. Run deployed web app with data objects: Now that you have successfully deployed the data objects and the web app, you can run the web app. The really nice thing is that all this generated code is now working against your own database and in your own environment. You can see all the behavior of the data objects through this web app and also use it as a guide in your own web development. Try this and you'll be convinced about TierDeveloper being a true Rapid Development tool.
STEP 5: DEVELOP REMAINING 50% OF YOUR APPLICATION
After running and verifying that all the generated code contains your desired functionality and runs correctly against your database, you are now ready to develop the rest of the application. The areas you are likely to need to develop in your application are:
1. Presentation Layer (Web Pages): Use TierDeveloper generated web app as a sample/example for quickly developing your own. You can even copy/paste a lot of the code from the generated web app into yours, thereby speeding up your development work even further.
2. Business Objects: Although TierDeveloper generated code contains all your data manipulation logic and some of your business rules as well (in the form of data validation or stored procedure calls), you will most likely have to develop additional business objects. If you're not an expert in your target platform (.NET, J2EE, or J2SE), you can learn from the generated data objects as your business objects are likely going to be in the same environment and would follow similar design approach.
|
|
|
|
|
Hello and hi
i have two word document files 1 and 2 in which
some text is written
i want to compare these words files(character by chracter)
and the result(difference) will stored in another word file 3.
so that at the last 3rd file contains the text of both first and 2nd file
and there difference is highlighted that following things are in 2nd file and not in ist file
Using VB 6.0
any helping material will also be appriciated
|
|
|
|
|
Why not use the FC program from the command prompt? This will compare each file and you can even redirect the difference to another file. Example:
FC "C:\YourPath\File1.txt" "C:\SomeOtherPath\File2.txt" > difference.txt
Other possiblities articles on CP are:
Chris Maunder wrote: A better front end to WinDiff[^]
Stephane Rodriguez wrote : Diff tool[^]
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
Only problem is that Word files are binary files. He wants to compare the text content. When comparing text files, FC and WinDiff are very nice, but comparing binary files either produces unintelligible output that doesn't accurately reflect the differences in text content (due to various binary format issues).
As for the original poster, I've never seen anything that can do this, but you could check out office.microsoft.com and see if any of their partner companies have anything.
Other than that, next time you send a Word document out, turn change tracking on and you can compare and merge changes when the document returns to you.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
Only problem is that Word files are binary files.
Another great reason for using XML as the data store in Word 2003.
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
In this case, someone should use the XML Diff tool from Microsoft (little known utility). Due to various whitespace problems and the fact that attributes can be unordered, it is better than simply doing a text diff because it canonicalizes the data before diff'ing it. I don't remember where to find it, but a search on MS's web site should reveal it's location (if it still exists as a project).
If nothing else, Nick, I think I have a copy lying somewhere around the office you could grab.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ali-imran wrote:
Using VB 6.0
Ok, if you must use VB 6.0, it appears that this is level of control is built into the Microsoft Word Object Library. You can read a quick article here[^]. If you want to do something in .NET, check the Office Primary Interop Assemblies[^]. HTH
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
Hi,
it must be me, but I cannot get my .net application working on any machines other than the one I developed it on.
The trouble started when I started using the OLEDB ADO.Net stuff. Since then, the application doesn't even load, and complains about unhandled exception error.
I've installed Framework 1.1, but still no joy.
What am I forgetting to do?
Pauwl
|
|
|
|
|
update your Microsoft Data Access Component? (MDAC)
Although I think .NET framework has it.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Pauwll wrote:
Since then, the application doesn't even load, and complains about unhandled exception error.
You might want to find out what the error is. I guess you probably don't have the .NET SDK installed on that machine, so you can't use a debugger. But at least you can do a catch-all try-catch block and show a messagebox or something with the error info. Then post it here, and we might be able to help you.
|
|
|
|
|
Did you add your connection string as a configurable option? This is what the <appSettings> section of your application configuration file (yourappname.exe.config) is for. When you move it to a different machine with a database of its own, change the connection string. If you are using a secure RDBMS and itnegrated security, make sure the user has permissions to access the RDBMS.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|