After instalaling WampServer on a Windows server you notice the websites are intermittent. The solution is the following lines in the Apache conf file:
AcceptFilter http none
AcceptFilter https none
It worked for me.
Sunday, December 30, 2012
Monday, December 24, 2012
Visual Studio 2012 debugger - A remote operation is taking longer than expected
A remote operation is taking longer than expected.
I received that error while attempting to run my newly started Windows Forms project in Visual Studio 2012. I've had VS 2012 for several months, and had never run into that problem. I searched the internet for solutions, and decided to repair VS 2012 by using the repair option on the install disk. That took about an hour and did not fix the problem.
I tried a WPF project. That gave me the same error. I tried starting the project without debugging, then attaching the debugger to the process. That didn't work because the processes wouldn't come up.
I decided to try a native application. So I tried one of my MFC apps. That worked. It had no problem with the debugger. So the problem seemed related to the dot net framework.
Then I remembered that my last project dealt with Windows Sockets. And I had installed many network monitoring programs in an attempt to reverse engineer the protocol used by a DVR. So I uninstalled all that software. It was something like 6 programs-- URL Sniffer-- things like that.
That fixed it. I restarted VS 2012 after uninstalling those programs, and it debugged fine. It's a real bugger when you get a bug in your debugger.
This is the real solution.
I received that error while attempting to run my newly started Windows Forms project in Visual Studio 2012. I've had VS 2012 for several months, and had never run into that problem. I searched the internet for solutions, and decided to repair VS 2012 by using the repair option on the install disk. That took about an hour and did not fix the problem.
I tried a WPF project. That gave me the same error. I tried starting the project without debugging, then attaching the debugger to the process. That didn't work because the processes wouldn't come up.
I decided to try a native application. So I tried one of my MFC apps. That worked. It had no problem with the debugger. So the problem seemed related to the dot net framework.
Then I remembered that my last project dealt with Windows Sockets. And I had installed many network monitoring programs in an attempt to reverse engineer the protocol used by a DVR. So I uninstalled all that software. It was something like 6 programs-- URL Sniffer-- things like that.
That fixed it. I restarted VS 2012 after uninstalling those programs, and it debugged fine. It's a real bugger when you get a bug in your debugger.
This is the real solution.
Friday, December 21, 2012
How to use the ATL OLE DB Consumer Wizard to Consume SQL Server Stored Procedures
This article explains how to use a MSSQL server stored procedure in your MFC application developed with Visual Studio 2012.
Start by creating a very simple table in MSSQL server. Give it two columns - ID, and a nvarchar(50) called PersonName. It is important that you start with a simple table, otherwise you might have problems making it work. That problem might be related to various column data type idiosyncrasies. So learn the basics first.
Make the ID column a primary key int that autoincrements.
Give the table a name - Persons.
Enter a few records.
Now you have a simple, two column table with a few records.
Now we'll create the stored procedure.
We want a stored procedure that inserts a record and returns that record's ID value.
Now to consume it in our MFC application.
In Solution Explorer, right-click on your project and click Add->Class.
In the Add Class Dialog box, select Visual C++ -->ATL-->ATL OLEDB Consumer.
The OLEDB Consumer Wizard will appear.
Select Data Source.
Use Microsoft OLE DB Provider for SQL Server.
Test the connection.
Then click OK.
Open up Stored Procedures, and select Insert Person. That is the stored procedure we created in an earlier step.
That will bring you back to the OLE DB Consumer Wizard Screen.
Notice that the consumer class and header file have been named after the stored procedure.
In order to build the project, you must comment out the #error directive in the newly created consumer class header file.
You must manually add the password to the connection string. "Password=whatever;"
Include the consumer class header file in your Dialog box header file.
Declare an instance of the consumer class.
Here is the code that implements the consumer class to insert a record and obtain the new record's ID.
Let me know if you have any questions or other problems you want to solve.
Start by creating a very simple table in MSSQL server. Give it two columns - ID, and a nvarchar(50) called PersonName. It is important that you start with a simple table, otherwise you might have problems making it work. That problem might be related to various column data type idiosyncrasies. So learn the basics first.
Make the ID column a primary key int that autoincrements.
Give the table a name - Persons.
Enter a few records.
Now you have a simple, two column table with a few records.
Now we'll create the stored procedure.
We want a stored procedure that inserts a record and returns that record's ID value.
Now to consume it in our MFC application.
In Solution Explorer, right-click on your project and click Add->Class.
In the Add Class Dialog box, select Visual C++ -->ATL-->ATL OLEDB Consumer.
The OLEDB Consumer Wizard will appear.
Select Data Source.
Use Microsoft OLE DB Provider for SQL Server.
Select the server name. I use localhost. Specify user name, password, and select the database.
Test the connection.
Then click OK.
Open up Stored Procedures, and select Insert Person. That is the stored procedure we created in an earlier step.
That will bring you back to the OLE DB Consumer Wizard Screen.
Notice that the consumer class and header file have been named after the stored procedure.
In order to build the project, you must comment out the #error directive in the newly created consumer class header file.
You must manually add the password to the connection string. "Password=whatever;"
Include the consumer class header file in your Dialog box header file.
Declare an instance of the consumer class.
Here is the code that implements the consumer class to insert a record and obtain the new record's ID.
Let me know if you have any questions or other problems you want to solve.
Subscribe to:
Comments (Atom)













