15,893,508 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by skydger (Top 152 by date)
skydger
13-Mar-16 15:04pm
View
Reason for my vote of 5 \n Interesting, thanks
skydger
15-Jan-16 15:35pm
View
Does the query:
Select top 1 ItemCode From MasterMemberUnitMapping where Unit=@Unit and
MemberNo=#temp1.MemberNo and MemberItemCode= #temp1.MemberItemCode and ItemCode in (Select ItemCode from UnitProducts where
Unit=@Unit)
return something? Try to comment update clause and just figure out it.
skydger
26-Aug-14 2:20am
View
It helped, thank you! :)
skydger
30-May-14 8:19am
View
Consider to use CONVERT to specific format at procedure like CONVERT(datetime, @start_date, 101). This should prevent your procedure from wrong datetime conversions on any localization.
skydger
30-May-14 5:34am
View
What format expects your ssrs report? Have you checked localization of hosting database and your local database?
skydger
10-Feb-14 5:52am
View
I've updated solution for your task
skydger
8-Feb-14 12:15pm
View
Does the property "Always overwrite" set up on each of the component's file?
skydger
6-Feb-14 4:33am
View
Hello, I've updated solution with some links. I hope it could be useful.
skydger
6-Feb-14 3:52am
View
Yes, it should work. As far as I know datacontract attributes can be obtained by /dc comand prompt key.
skydger
5-Feb-14 3:14am
View
Ok, how many records Food and Item tables contain? Which tables contain CarA, CarB, Car1 and Car2 ?
skydger
5-Feb-14 1:37am
View
Please provide us 'food' and 'item' tables structures or samples of data.
skydger
4-Feb-14 14:11pm
View
What is the query do you use?
skydger
4-Feb-14 13:55pm
View
+5 :)
skydger
29-Jan-14 3:32am
View
Well, it works with doubles too if to use MathContext in constructor:
MathContext mc = new MathContext(2, RoundingMode.HALF_UP)
BigDecimal a = new BigDecimal(2.3d, mc);
http://docs.oracle.com/javase/1.5.0/docs/api/java/math/MathContext.html
skydger
29-Jan-14 3:27am
View
Thank you :)
skydger
27-Jan-14 8:25am
View
This is not an appropriate question to answer. Please improve it or use your favorite search engine instead.
skydger
24-Jan-14 6:08am
View
+5!
skydger
24-Jan-14 2:01am
View
Consider to use
for html 4.0 or to use CSS. Please refer following link for details: http://www.w3schools.com/tags/att_font_color.asp
skydger
23-Jan-14 14:00pm
View
Where do you wish to highlight these columns?
skydger
19-Jan-14 14:35pm
View
Are you sure you have enough access rights to read LocalMachine registry branch?
skydger
19-Jan-14 10:03am
View
+5Indeed :)
skydger
18-Jan-14 11:10am
View
+5 :)
skydger
17-Jan-14 14:26pm
View
The result table you expect is not like pivoted tables. It looks like two (or more) joined tables. Pivoted tables are those which row values become columns headers as a pivot result.
skydger
17-Jan-14 2:18am
View
Thank you! :)
skydger
17-Jan-14 2:17am
View
Thank you :)
skydger
6-Jan-14 9:45am
View
I've updated the solution, please follow that link. It should help.
skydger
2-Jan-14 6:47am
View
How did you install your app to that machine? Are you sure that COM library exists on that computer? Did you register its COM interface with regsvr32 there?
skydger
27-Dec-13 13:53pm
View
It is surely 5 :)
skydger
24-Dec-13 13:11pm
View
You are welcome :)
skydger
24-Dec-13 3:28am
View
The information you provided is not enough for exact solution. Please improve your question adding a target SQL-engine, table(s) structure with its data sample and expected output. Remember, we can't see your screen and read your thoughts.
skydger
23-Dec-13 6:05am
View
Thanks :)
skydger
22-Dec-13 13:52pm
View
You're welcome :)
skydger
7-Dec-13 11:24am
View
You're welcome :)
skydger
6-Dec-13 9:08am
View
I've updated solution for this task. I also added two links which might be helpful.
skydger
6-Dec-13 7:07am
View
You are welcome!
I suppose, the better way to to this, is to add a new column for stages.
like
BokID QuesId StageCode Question
1 1 1 Question1
2 2 1 Question2
.....
10 10 1 Question10
11 1 2 Question1
.....
20 10 2 Question10
.....
Then you can easily update only stage desired. If this solution is acceptable, the trigger should be modified a little.
skydger
6-Dec-13 3:26am
View
This is the repost of another issue: http://www.codeproject.com/Questions/692995/select-inner-join-query-in-mysql
Please delete this and improve the previous one.
skydger
6-Dec-13 3:21am
View
You're welcome!
skydger
4-Dec-13 3:42am
View
Why to use scalar function instead of stored procedure? What are the arguments it must contain? What is the value the function should return? Please improve you question.
skydger
3-Dec-13 8:56am
View
What is the target table structure? Does it have any 'not null' constraints?
skydger
3-Dec-13 1:25am
View
Which SQL engine do you use? Have you tried to debug your script step by step?
skydger
2-Dec-13 7:54am
View
Oops, my mistake, thanks! I've updated solution.
skydger
16-Oct-13 4:47am
View
Actually it depends on your task and realization, but in common issues you could use single procedure which processes every node or table row/column or whatever and which makes inserts desired.
skydger
11-Jun-13 4:23am
View
Please update your question to provide us a code sample for controls initialization.
skydger
10-Jun-13 7:42am
View
Do these controls visible at design time? Is it possible that controls have the same color as transparent one?
skydger
28-May-13 2:12am
View
Thank you :)
skydger
27-May-13 4:13am
View
You're welcome :)
skydger
27-May-13 2:11am
View
Have you registered a click button message (BN_CLICKED)?
skydger
23-May-13 8:04am
View
There could be some security issues on 2008 server. Some I/O operations might use privileged rights only even if user works with application from administrator account.
skydger
23-May-13 5:46am
View
Consider to use pivot operator, if your SQL Server version is 2005 or higher
skydger
21-May-13 2:28am
View
I suppose so. There are the steps to create aitomation application. Also you probably would use an MS Excel wrapper. Try to check this link (please, browse all C-classes from CApplication.h to CWorksheets.h:
http://www.codeforge.com/read/84409/CWorkbook.h__html
skydger
16-May-13 14:19pm
View
Use ExecuteSQL method of the CDatabase object:
http://msdn.microsoft.com/en-us/library/67cze9b7(v=vs.80).aspx
skydger
16-May-13 9:45am
View
Have you considered to use XmlWriter instead of this?
skydger
15-May-13 7:45am
View
Are you sure you've added _T() modifier to your format string? If so try to replace _T() modifier to L modifier. For example sDsn.Format(L"ODBC;DRIVER...",...);
skydger
15-May-13 7:09am
View
Your code sample looks fine, why don't you add it to your dialog-based application?
skydger
15-May-13 4:46am
View
I suggest you to update your question with this code sample.
As for error... Please change the path to mdf file to real database name. For example "Database={Northwind}".
skydger
15-May-13 4:30am
View
As Jochen Arndt wrote you won't get a complete code here. Your request covers a wide field of solutions and we cannot guess which one of them you ment. Please refer this link, maybe this tutorial will be useful:
http://www.informit.com/library/content.aspx?b=Visual_C_PlusPlus&seqNum=190
skydger
6-May-13 15:58pm
View
Is it possible, that solution has mixed configurations for your dll and other projects? For example an dll project has Debug configuration and site's project has Release config.
skydger
6-May-13 9:36am
View
Maybe I don't get it, but do you want something like this?
SELECT Faculty_Name,
CASE MAX(rate) when '1' then 'Excellent'
when '2' then 'Good'
when '3' then 'Fair'
when '4' then 'Poor'
when '0' then 'Not Applicable' end
AS rate
FROM Faculty AS f
WHERE facid = bfid
GROUP BY Faculty_Name
skydger
25-Apr-13 14:35pm
View
How about to use different features with respective components in them?
Feature_A
- Component_A1
- Component_A2
...
skydger
15-Apr-13 15:16pm
View
Sounds like you want to create your own compiller. How about to add existing one to your project?
skydger
8-Apr-13 8:35am
View
It depends on what kind of queries do you use.
If these queries are a number of 'insert' statements, you could use 'with tablock' hint. But if you have miscellaneous queries, then you could use
'set transaction isolation level read commited', with 'READ_COMMITTED_SNAPSHOT' option set to off.
skydger
3-Apr-13 13:19pm
View
Thank you :)
skydger
13-Mar-13 4:18am
View
Hi. What is the database engine do you use?
I also suggest you to type topic of your question in English.
skydger
11-Mar-13 5:40am
View
I suggest you to add Jurassic tag to your question.
I havn't used this before, but I suspect that your issue is in an HTML comment tag "<!--". Try to remove it, maybe this engine does not parse it.
skydger
11-Mar-13 3:23am
View
What is the type of your 'engine' object?
skydger
7-Mar-13 14:45pm
View
Which http service do you use? Apache, IIS or...? What is in MySql section of php_info do you have?
skydger
10-Feb-13 12:36pm
View
Ok, it explains your confusion. So you may achieve this by launching Command Prompt (cmd.exe) in MS Windows (or launch a console in Linux). Then you should execute your program like "myapp.exe -hello -world". "-hello" and "-world" will be in char *argv[] array.
There is another way to do this. In Visual Studio in your executable project's poperties window go to Debuging section, then write down your "Command arguments" which will appear at the start of you app.
skydger
10-Feb-13 9:53am
View
Either you was learning a different language or it was a misprint. :) Non of entry point functions has such notation. C++ standard specifies only two of them mentioned in all solutions for your question. I updated this solution with link to ISO C++ standard.
As for 'bracketed phrases'... If you meant char* argv[] then see the complete Solution 1. Well... if you never faced programs with cpmmand-line parameters, then I understand your confusion. Please see this article, maybe it will make it clear for you:
http://en.wikipedia.org/wiki/Command-line_interface
skydger
9-Feb-13 14:54pm
View
Deleted
It is the same query as OP used.
skydger
8-Feb-13 6:19am
View
You're welcome :)
skydger
8-Feb-13 4:18am
View
You're free to write both of them. It is just a function without name :). If you need a button manipulation use second code.
Here is more info about the lambda expressions:
http://msdn.microsoft.com/en-us/library/bb397687.aspx
skydger
7-Feb-13 9:48am
View
What query do you use?
Without knowing structure of your tables no one could help you. Please improve your question and tell a secret of your 'plans' table which holds relation to magic 'combination values'.
skydger
7-Feb-13 6:20am
View
How do you update data?
There are too many intermediate actions for the service which you plan to make 'Live'. It is almost impossible to refresh too often from Excel datasource. Every schedule in SQL server has a minimum period to launch a job (approx. 6 times in a minute!).
Why don't you just load data form server directly to your database?
skydger
6-Feb-13 2:21am
View
Fair enough.
My 5 xD
skydger
6-Feb-13 1:49am
View
I just wonder what are these objects to force asking such a question?.. :) The second question is... what is the reason of these IDs?.. Is there any tracking of them etc?
skydger
5-Feb-13 14:46pm
View
What are these objects raster or vector? How much memory does the largest one consume?
skydger
4-Feb-13 1:07am
View
Hello! You're welcome :)
skydger
2-Feb-13 11:35am
View
Well, if you expect your application to work with any sql engine, then you should implement as simple queries as possible (common to all of the sql engines). The most logic had to be in your C# code. But if you expect to use particular sql engine (for example, all Oracle versions), you should learn more about its versions and consider to use stored procedures.
skydger
2-Feb-13 10:38am
View
I've updated solution, please check it out.
skydger
2-Feb-13 10:37am
View
The first solution could be used in stored procedure.
As for MERGE... It is not a simple query :)
if... else ... sometimes more preferable clause than MERGE which has more complex logic. Besides it's not compatible with SQL Server 2000.
skydger
30-Jan-13 7:20am
View
Which version of VS 10 do you use? Which type of C++ projects do you have? This project type must be in CLR project type.
skydger
30-Jan-13 1:23am
View
You should make your methods thread-safe, if its use shared variables.
Please read this article http://en.wikipedia.org/wiki/Thread_safety
skydger
26-Jan-13 12:32pm
View
You don't need to use AttachDbFilename in your connection string. But you need to add database name such as following
Database=myDataBase;
Also, please use try/catch block to get an exception messages.
skydger
26-Jan-13 11:57am
View
My 5 :)
In addition to your solution. I think one could consider to use NoSQL database enginesas alternative...
skydger
26-Jan-13 11:48am
View
Does identity exist on column 'id'? Are there any contraints onany of the table columns?
skydger
23-Dec-12 5:23am
View
Have you found in wich line of your code this error occurs?
skydger
22-Dec-12 14:00pm
View
How do you initialize your Excel appliacation and workbook?
Have you opened a workbook? Does workSheet exist?
skydger
18-Dec-12 15:57pm
View
It is wierd.
Have you tried to create getters (and setters if needed) for those classes?
skydger
18-Dec-12 6:02am
View
Have you tried to add some member of dbConnect type to frmFulBldCuntDet class?
skydger
18-Dec-12 5:51am
View
If you have no any foreign keys with cascade delete constraint then you should create a procedure which combines two separate deletes
DELETE FROM usermessages
WHERE messageid = 1
DELETE FROM messages
WHERE messageid = 1
You can also create a trigger on one of these tables on delete action.
skydger
20-Nov-12 2:17am
View
As far as I know there are settings which allow to inform user when shared libs or other components been used by another process and therefore it asks for the action. But I doubt that this information dialog would appear if other process is not running.
skydger
16-Nov-12 1:46am
View
You should create html template to fill it while fetching query data. Please refer php documentation about it. http://php.net/manual/en/book.mssql.php
skydger
15-Nov-12 8:00am
View
I suppose your uninstallation process wasn't finished correctly, so the uninstallation sctipt execution stops before the registry cleanup routine starts. Try to check why those files hasn't been removed. I think it is an issue.
skydger
15-Nov-12 1:36am
View
Are there any files left after uninstallation on those target systems? Does this key in your setup project exist in separate Component or with some application files? What is the type of your project: 'Basic MSI Project' or 'Install Script Project'?
skydger
14-Nov-12 14:49pm
View
This is strange...
I found the similar issue with this here: http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/194ddefd-2d21-4b34-b630-96852ae7d03d/
But the subject is Exchange 2007, not 2003... Bit there's no a word about Service Pack 2.
skydger
14-Nov-12 13:16pm
View
This is wierd.
Are there any permissions set with your registry key? What is the version of target system with this issue?
skydger
13-Nov-12 14:05pm
View
It doesn't matter, how to create custom dialog form. It is convenient to use 'atttached' project to the solution. But also it is possible to use libraries from separate projects.
skydger
8-Nov-12 2:59am
View
What is the result set you are expecting to get?
skydger
7-Nov-12 4:56am
View
You need to set user mappings for the second server. This article could be useful: http://www.databasejournal.com/features/mssql/article.php/3691721/Setting-up-a-Linked-Server-for-a-Remote-SQL-Server-Instance.htm
skydger
7-Nov-12 3:22am
View
The functions lstrcmpi() and lstrcmp() support this (PCSTR) string type too.
Please see this article for details about string types: http://www.codeproject.com/Articles/2995/The-Complete-Guide-to-C-Strings-Part-I-Win32-Chara
skydger
7-Nov-12 0:25am
View
Are there MS Office Word and PIA installed on that server?
skydger
7-Nov-12 0:15am
View
So do you have type library for this? What OleView tells about it? Is it .NET COM visible library or ATL?
skydger
6-Nov-12 1:08am
View
What is the database engine do you use?
skydger
1-Nov-12 17:19pm
View
Are you sure you've entered any instance name? MSSQLSERVER must be as a default. Try to find some information in installation log for details.
skydger
1-Nov-12 15:12pm
View
Check the protocols in SQL Server Configuration Manager (Configuration Tools folder in Program menu). Which ones are enabled?
skydger
1-Nov-12 14:55pm
View
Can you establish connection via SQL Server Management Studio to your server?
skydger
30-Oct-12 15:09pm
View
Please see updated solution
skydger
30-Oct-12 14:25pm
View
Try to remove 'struct' clause from your vector definition
skydger
30-Oct-12 5:28am
View
To check that your COM registered in the right way you can use OleView.exe utility from your Visual Studio tools, or to search registry in following keys:
HKEY_CLASSES_ROOT
HKEY_LOCAL_MACHINE\SOFTWARE\Classes
If there are no any signs of your COM class, then you need to extract your COM interfaces data from typelibrary and incapsulate it into your setup program.
skydger
30-Oct-12 4:33am
View
What kind of setup project have you created? Is it selfregistering COM component? Are you sure the registry of target machine has values for your COM classes and interfaces?
skydger
25-Oct-12 1:23am
View
What are the types of your 'Name' and 'Locality' arguments?
skydger
22-Oct-12 14:42pm
View
Well, there are several ways to prevent this. The first - is to store your database file in one of current user's folder. For this purposes, please see following link http://msdn.microsoft.com/en-us/library/ms995853.aspx
Secondly you can just check for user privileges elevation. For example refer this article:
http://zerosandtheone.com/blogs/vb/archive/2009/07/29/vb-net-how-to-tell-if-a-user-can-elevate-to-admin-rights-in-vista-and-windows-7.aspx
skydger
19-Oct-12 2:26am
View
You're welcome :)
skydger
18-Oct-12 4:01am
View
I think I got the issue. Try to refer this book, chapter 9. http://fs1.bib.tiera.ru/content/dvd42/Heege%20M.%20-%20Expert%20C++.CLI.%20.NET%20for%20Visual%20C++%20Programmers(2007)(352).pdf
I think it could be useful.
skydger
18-Oct-12 3:35am
View
Is it possible, that target systems for your projects differs?
skydger
18-Oct-12 3:18am
View
Nice solution. It's not just convertion strings answer, but a complete guide to work with COM xD. My 5.
skydger
17-Oct-12 12:47pm
View
What version of target operating system? What is the user rights which uses your applicaton?
skydger
17-Oct-12 8:14am
View
Thanks for advice :)
skydger
17-Oct-12 3:28am
View
If there's no such a plug-in, I suppose it is not possible. Inno Setup is a setup 'compiller', so you have to use third-party editors such Notepad or others to create such files.
skydger
16-Oct-12 15:36pm
View
Don't mention it :)
skydger
16-Oct-12 15:01pm
View
Have you tried to run SQL Server Profiler? How many transactions per minute it has?
skydger
12-Oct-12 4:28am
View
What connection string do you use?
What does SQL Server Configuration Manager show on SQL Server Network Configuration -> Protocols for SQLEXPRESS shows? Which protocols are enabled?
skydger
12-Oct-12 1:32am
View
Are there those values with same id's also identical? Anyway you could use EXISTS operator to check those rows before inserting them. Also you can load all the inserts data to tmporary table and then to use MERGE statement, if those rows with the same ids are identical.
skydger
10-Oct-12 14:06pm
View
I updated solution, please check it out. I hope it will be useful
skydger
10-Oct-12 8:15am
View
Is there any information from sys.dm_tran_locks or sys.sysprocesses views?
skydger
10-Oct-12 4:51am
View
Have you tried to create such a query? Where have you stuck?
skydger
8-Oct-12 8:54am
View
I agree, it is the way I got the question, so lets see what he exactly needed :) Anyway your solution more comprehensive.
skydger
8-Oct-12 6:04am
View
How does your application load data to SQL server from Excel? There are different ways to load data from Excel or CSV data into SQL server, which one is used in your application?
skydger
7-Oct-12 12:29pm
View
Could you please give an example of tables' contents?
skydger
5-Oct-12 10:34am
View
Please see links in updated solution
skydger
5-Oct-12 10:06am
View
Oh, I'm sorry. In this article there is a suggestion to use COM technology. You can create COM visible components to use it in you C++ project and vise versa. When there will be a C# COM visible interfaces, you can create C++ wrapper to use them as a simple class.
skydger
5-Oct-12 4:57am
View
You're welcome :)
skydger
5-Oct-12 3:26am
View
As far as I know, Dreamweaver distributive does not contain php modules, so you have to install php manually.
skydger
5-Oct-12 3:21am
View
Please see updated solution
skydger
4-Oct-12 16:32pm
View
Is there any relationship between first and second table? Any column or calculated column.
skydger
4-Oct-12 3:33am
View
Is there any exception messages or something? Could you, please, provide us a code sample?
skydger
3-Oct-12 3:10am
View
Is it possible that your script's work starts when net interface is not initialized yet?
skydger
3-Oct-12 2:54am
View
Does these dates in different tables really equal to each other? Is it possible that dates differs for miliseconds? If so, you could try to use DATEPART(Year, A.Date) = DATEPART(Year, B.Date) etc. If not, it would be great if you provide example of your tables.
skydger
2-Oct-12 3:49am
View
And the question is?..
skydger
2-Oct-12 2:58am
View
Please provide us a code you use for autocompletion.
skydger
1-Oct-12 16:30pm
View
Why don't you use join of A.DisplayAsID = B.DisplayAsID? It might help
skydger
1-Oct-12 16:04pm
View
How does database data load to Excel?
Is it possible to optimize SQL query to exclude those empty spaces?
skydger
20-Sep-12 15:22pm
View
Did you installed a PIA (Primary Interop Assemblies)?
http://msdn.microsoft.com/en-us/library/aax7sdch.aspx
Also you can try OpenXML from MS:
http://msdn.microsoft.com/en-us/library/office/bb448854.aspx
skydger
20-Sep-12 15:15pm
View
It is as implementation of classes in C#.
Please see the following article:
http://msdn.microsoft.com/ru-ru/library/c3fd4a20.aspx
skydger
19-Sep-12 8:00am
View
Sure, if it will be possible for me :)
I don't know, what is the structure of that interface (IMyObj2), but sometimes it is more convenient for me to create custom array interface (for example IMyObj2Collection) but not the safearray. If I need not just array of custom types, but something like map<,>.
skydger
19-Sep-12 7:05am
View
As far as I know, CComSafeArray uses VARIANT subsets of data, but not user defined. Besides it is a template wrapper class of SAFEARRAY and could not be flexible enogh for all the cases. So I think that using it with user defined types is little bit tricky. But maybe there is a solution to do so.
As for your question about using SAFEARRAY(IMyObj*)* instead of structure: it is the same as described, and it is simplier, because you need to create instances only (CoCreateInstance(...)) and release them.
skydger
19-Sep-12 4:35am
View
You're welcome :)
skydger
18-Sep-12 6:55am
View
Sure, no problem :)
I use VS2005, so it has no library declaration in .idl file's template. The code is following:
[
uuid(00000001-0001-0001-0001-000000000099),
version(1.0),
helpstring("Library for my interfaces")
]
library MyIfcLibrary{
[
object,
uuid(00000002-0002-0002-0002-000000000002),
oleautomation,
nonextensible,
helpstring("First Interface"),
pointer_default(unique)
]
interface IFirstInterface : IDispatch{
};
...
};
If project set up properly, you'll get .tlb file in output directory after building a project.
skydger
17-Sep-12 14:18pm
View
Have you considered to split data in that huge table to minor portions of data (100k - 300k of records) into global temporary indexed tables?
skydger
17-Sep-12 5:08am
View
Have you tried to create standard CDialog window?
Although it might be a problem. If there is no any window, you can try to attach your dialog to desktop:
CWnd wnd;
wnd.Attach( GetDesktopWindow() );
CDialog dlg;
dlg.Create( MAKEINTRESOURCE(IDC_MY_DIALOG), &wnd);
...
wnd.Detach();
skydger
17-Sep-12 4:42am
View
Ok, steps are following as I understood you application.
When user is not found in database, then Form1 appeared, but when you call Show() method, the form 'detaches' from that scope and works independantly. And the similar problem with another form.
So there are at least three solutions.
a) You can make objects of Form1 and Form2 a private members of your main class, therefore can't lose contol on them when main thread ending its work.
b) You can create delegates which being invokeed when Form1 or Form2 are closing.
c) You simply can use ShowDialog() method.
For example:
MessageBox.Show("username is present already choose a diffrent username");
this.Hide();
Form1 f4 = new Form1();
if( f4.ShowDialog() == DialogResult.OK ){
// creating a new user
}else{
// no action?..
}
this.Show(); // if needed
skydger
17-Sep-12 4:23am
View
I agree that this is not a good design of application, the DDX_Control and other things are better but also takes a time for additional code. If there is a need to use temporary variable whithout member object, GetDlgItem(...) is the way to do so.
Show More