16,004,564 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 .NET 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 strogg (Top 57 by date)
strogg
16-Nov-14 9:40am
View
Go to data directory, open the file 'pg_hba.conf' and add the line
-----
# IPv4 local connections:
host all all 192.168.1.10/24 md5
-----
where 192.168.1.10 is the remote ip from which you will access postgres server. Or you can use
---
host all all 0.0.0.0/0 md5
---
which should allow all ip addresses to connect.
Replacing 'md5' in the line with 'trust' will allow users to connect without a password. Restart server and try.
Don't forget to add these lines to 'postgresql.conf' file
---
listen_address = '*'
port = 5432
---
If you omit port, it should default to 5432. Turn firewall off while testing. It's better you test on a local network. If you're trying to access it through the internet, you must forward the port you use through the router as well. Hope this helps
strogg
14-Nov-14 13:58pm
View
On your server, go to your data directory, open postgresql.conf and uncomment the line listen_address (remove #) - set it to: listen_address = '*'
Restart your pgsql server. make sure your server's firewall is allowing port 5432. Temporarily turn off your firewall to test if you like.
strogg
26-Nov-13 13:18pm
View
By auto-size you mean to auto size the rich text box before capturing? It's not a good idea since the contents may exceed the screen area & you won't get the full image.
There is another more complicated way to render the contents into an image. Take a look for the answer to this question here.
http://www.codeproject.com/Questions/469035/Csharp-RTF-text-to-bitmap-image-Any-easy-way-aroun
Another article about displaying print preview & print:
http://www.codeproject.com/Articles/42823/RichTextBoxDocument
strogg
29-Oct-13 7:01am
View
Make sure that the control is visible on the screen. I tested the code by placing a PictureBox next to it and assigning the bitmap to the picture box (pictureBox1.Image = bmp;) on a button click. It works for me. I'm getting all the contents.
Paste the below code into a file named Rtf.cs and compile it with
%windir%\Microsoft.NET\Framework\v3.5\csc /t:winexe Rtf.cs
at the command prompt and try
using System;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
public class Rtf
{
public static void Main()
{
Form frm = new Form();
frm.Width = 400;
frm.Height = 300;
RichTextBox rt = new RichTextBox();
rt.Width = 175; rt.Height = 100;
rt.Location = new Point(10, 10);
frm.Controls.Add(rt);
PictureBox p = new PictureBox();
p.Width = 175; p.Height = 100;
p.Location = new Point(200, 10);
frm.Controls.Add(p);
Button b = new Button();
b.Width = 175; b.Height = 23;
b.Location = new Point(10, 120);
b.Text = "Try!";
b.Click += (s, ea) =>
{
rt.Update();
Bitmap bmp = new Bitmap(rt.Width, rt.Height);
using (Graphics g = Graphics.FromImage(bmp))
{
g.CopyFromScreen(rt.PointToScreen(Point.Empty), Point.Empty, rt.Size);
}
p.Image = bmp;
};
frm.Controls.Add(b);
frm.ShowDialog();
}
}
strogg
29-Oct-13 6:59am
View
Deleted
Make sure that the control is visible on the screen. I tested the code by placing a PictureBox next to it and assigning the bitmap to the picture box (pictureBox1.Image = bmp;) on a button click. It works for me. I'm getting all the contents.
Paste the below code into a file named Rtf.cs and compile it with
%windir%\Microsoft.NET\Framework\v3.5\csc /t:winexe Rtf.cs
at the command prompt and try
using System;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
public class Rtf
{
public static void Main()
{
Form frm = new Form();
frm.Width = 400;
frm.Height = 300;
RichTextBox rt = new RichTextBox();
rt.Width = 175; rt.Height = 100;
rt.Location = new Point(10, 10);
frm.Controls.Add(rt);
PictureBox p = new PictureBox();
p.Width = 175; p.Height = 100;
p.Location = new Point(200, 10);
frm.Controls.Add(p);
Button b = new Button();
b.Width = 175; b.Height = 23;
b.Location = new Point(10, 120);
b.Text = "Try!";
b.Click += (s, ea) =>
{
rt.Update();
Bitmap bmp = new Bitmap(rt.Width, rt.Height);
using (Graphics g = Graphics.FromImage(bmp))
{
g.CopyFromScreen(rt.PointToScreen(Point.Empty), Point.Empty, rt.Size);
}
p.Image = bmp;
};
frm.Controls.Add(b);
frm.ShowDialog();
}
}
strogg
26-May-12 4:14am
View
Just requires a little guesswork. Try
YourTabControl.Enabled=false;
strogg
5-Feb-12 3:51am
View
Here's one way to do it in vb.net
Dim con As New SqlConnection("Your connection string")
con.Open()
Dim cmd As SqlCommand = con.CreateCommand()
cmd.CommandText = "Your statement to execute"
cmd.ExecuteNonQuery()
con.Close()
You need to import System.Data.SqlClient.
If you do not know anything, this is not the way to learn. Read some concerned book or go through the MSDN and learn before you use.
strogg
4-Feb-12 3:34am
View
There are different ways to create, they all work. Use the ones to your convenience. If you have all the contents to write in one variable, you can simply call
System.IO.File.WriteAllText("C:\xxx.txt",MyString);
It opens (OVERWRITES IF EXISTS) writes & closes the file. There's no other code required.
strogg
4-Dec-11 13:02pm
View
You changed UserId to int? Are you have set both Applied.UserId and JobSeeker.UserId to int? Also try by putting [] brackets around column names
strogg
3-Dec-11 13:02pm
View
The content you have posted seems to be from a different file. Open your file & make sure there's no null at the location where it's terminated. Better, try opening some other text file. I hope y'r malloc() is succeeding. Try LocalAlloc() maybe.
strogg
3-Dec-11 8:49am
View
There's no such thing. You need not worry about such misconceptions.
strogg
2-Dec-11 13:45pm
View
There seems to be a bug in .net running on win7 64 bit. I found some complaints and responses from microsoft here. http://connect.microsoft.com/VisualStudio/feedback/details/94524/printdialog-useexdialog-causes-unresponsive-ui-when-invoked-from-toolstrip-button
I've also heard that problems with the PrintDialog have been fixed in .Net 4.0 - maybe you can check using famework 4
strogg
1-Dec-11 3:10am
View
Check my answer here
http://www.codeproject.com/Answers/128624/Using-data-in-DataTables-in-Microsoft-Report-Viewe#answer1
Also remember to remove any designer generated datasources for the viewer
strogg
20-Jun-11 9:08am
View
Just figure it out genius!
Take off the <asp:HyperLinkField ... column
Or if you want the hyperlink in the second col, just delete the second <<asp:BoundField & move the hyperlink column up where you want
strogg
20-Jun-11 9:02am
View
You've done right, but you had to create the DataSet in the designer. Anyway you can download the files here - http://www.yourfilelink.com/get.php?fid=697834
Choose open website & open the folder
strogg
16-Jun-11 16:18pm
View
Deleted
Whoops, yes indeed. Sorry didn't notice the array at all :|
strogg
16-Jun-11 16:09pm
View
It depends on the kind of data you wish to bind to the report viewer. You can use the SqlDataSource if you want to bind data from an sql server database. You can also set your own DataTable to the report as the datasource. If you'll be more clear as to what kind of data you have to use with the reports, i can specifically tell you how to do it.
strogg
16-Jun-11 8:58am
View
Deleted
There's no need for [] after delete
strogg
16-Jun-11 8:54am
View
lol, just happened to see y'r profile. It's too cool. I think i'm on the same road - almost there :)
strogg
14-Jun-11 12:02pm
View
Here's a good article & a library with source
http://www.codeproject.com/KB/system/serial.aspx
strogg
14-Jun-11 11:51am
View
BindSource? there's no thing such as a BindSource, tell me what exactly you want to do & i'll let you know
strogg
12-Jun-11 15:01pm
View
Strange, i've used this in a win app, not a console. RegisterHotKey successfully fails (returns 0) when another instance calls it. I think you're experiencing this behavior because you're passing NULL as the window handle. If you have the time, create a hidden window just for the purpose of handling messages & try. The second instance will probably fail then
strogg
12-Jun-11 14:46pm
View
There's no error in your code shown. I guess the error is occurring in another event handler of your datagridview. Comment out other events handled by the datagridview. That'll help you to narrow down to the mistake.
strogg
12-Jun-11 14:40pm
View
Forgot to mention, here's a link which explains enabling RPC on HTTP
http://blogs.msdn.com/b/asiatech/archive/2010/09/03/how-to-configure-quot-rpc-over-http-quot-for-dcom-communication-in-windows-2003.aspx
strogg
12-Jun-11 14:23pm
View
A comprehensive list!
strogg
8-Jun-11 10:48am
View
Well, blow me if VMs do not gobble up lots of RAM. The guy's hosting his own app & not selling hosting services - & i just expressed my opinion on what's better for him. I don't need you to judge me. Why don't you people respect other opinions or just shut up? You sound like an idiot comenting like this.
strogg
7-Jun-11 13:24pm
View
There's no paging available for datagridview. And there's a good reason for it. Windows controls like datagridview are more powerful and can load tens of thousands of rows and still work fast. Web pages do not work well with so much data easily and therefore paging is employed to overcome the shortcomings. There's no point in asking for paging in a windows app. Sorting and searching also works in a snap with all the data present in one view. You have to realize the advantages.
strogg
7-Jun-11 13:10pm
View
Yes, i think there's no way to build 64 bit apps using the jet engine. It's too old. I strongly suggest you to use a better database for your future works. Good luck.
strogg
6-Jun-11 19:13pm
View
??? I think i just said the same thing. And you cannot "mix" different instruction families in one executable at all.
strogg
6-Jun-11 10:20am
View
Ah, good. Glad you could work it out
strogg
6-Jun-11 10:17am
View
In that case, as the other person pointed out, change the platform target from Any CPU to 'x86'.
In the solution explorer, right click on your project & click properties. Go to Build (or compile) tab and change Target from 'Any Cpu' to x86 (for both debug and release). It'll mostly work. Also give x64 a try. Let me know if it works.
strogg
13-May-11 10:56am
View
Check my answer to a similar thread here
http://www.codeproject.com/Answers/186600/WindowsForm-works-but-WebForm-has-single-threaded-.aspx
strogg
11-May-11 15:46pm
View
I suppose you can. Writing a trigger is the same. If you have the management studio just go ahead, create an insert trigger on the table & put the code there. But it may mess up the values returned by the Select @@IDENTITY statements (if you're using them). You'll have to try. Even i don't use triggers.
strogg
10-May-11 16:16pm
View
TBBUTTON is a structure defined in the Windows API. ToolBarButton is a class in the .Net Framework. They're totally different. Since you are interoping with the API (by calling SendMessage), you'll have to define the TBBUTTON structure in C#
strogg
6-May-11 5:52am
View
Strange, try passing NULL to the Security Descriptor (to use default security) - Also did you forget to put a double-backslash for global (Global\\Name)?
Also, you have not shown the OpenFileMapping() code (in other process)
strogg
1-May-11 5:03am
View
You're using FormsAuthentication.RedirectToLoginPage()
It always takes you to the login page. That is not what you want. Use Response.Redirect() to the required page instead
strogg
1-May-11 4:58am
View
One possibility is that you have a wav file with a compressed format and the codec is missing in the system. Should not be a problem if it's plain PCM wave file
strogg
27-Apr-11 8:04am
View
You cannot bind queries on local reports. You must supply a datatable / dataset to the report. Check this answer to a similar question - may help you.
http://www.codeproject.com/Answers/128840/Using-data-in-DataTables-in-Microsoft-Report-Viewe.aspx#answer2
strogg
26-Apr-11 12:11pm
View
There's no main method in asp.net. Check if you have the global.asax file in your solution. If not, right click on solution & go to add new item & choose "global application class". It should create a file with some pre-defined functions. If not, add a file in your root called Global.asax & add the function
void Application_Start(object sender, EventArgs e) {}
That'll be the startup function for y'r web app. But try creating your object in an aspx file with ASPCompat set to true. I doubt it'll work in global.asax
strogg
25-Apr-11 14:08pm
View
Try this. Create a new form, add a list view & set AllowDrop to true in the properties, nothing else.
Add a DragEnter event, put some code to test like - Console.Beep(1000,500) in it & try. It's working for me
strogg
19-Apr-11 7:31am
View
Couldn't see the img @ imageshack - it was blocked. But looked at apkitchen and Holy Macro!! The image's size is 1280x1024 & you're resizing it to 40x40? Browsers don't do a good job at such big resizes and neither should you expect to. For best results, you must resize images to your requirement using imaging tools and upload. Try not to set height & width inside img tag.
Good luck
strogg
18-Apr-11 3:08am
View
Can't tell unless i see the code & the picture. By the way, you don't have to use top:90% to place it at the bottom. It'll only be approximate. Use bottom position instead :
left:0px; bottom:0px;
(without specifying top). It'll stick to the bottom & the element's height won't have any adverse effects on the position. (Likewise, you can also use bottom & right)
strogg
16-Apr-11 14:15pm
View
Try setting the datasource to ds.Tables[0]. Also make sure it has some data in it. Make sure you have 2 pre-defined columns in the datagridview & their 'DataPropertyName' set to 'cuccd' and 'cucna'
strogg
16-Apr-11 13:21pm
View
you're using 'filepath' to open the connection. I guess u forgot to use connectionString you've created :)
strogg
17-Mar-11 13:02pm
View
Open file using
CreateFile() - Use dwDesiredAccess=GENERIC_READ, dwCreationDistribution=OPEN_EXISTING
It'll return a HANDLE. Pass it on to ReadFile()
Eg:
BYTE *b; // allocate mem
ReadFile(handle,(void*)b,xx,&xx,NULL)
Now call IStream->Write((void*)b,xx,NULL)
strogg
14-Mar-11 12:56pm
View
I see you've made a simple mistake in the call to StgCreateStorageEx(). The last param should be of type void ** (a pointer to pointer)
The proper syntax is (void**)&pStg
Try it & let me know
strogg
11-Mar-11 4:29am
View
I don't think that gtk supports win32 ipc. Looks like communicating through sockets is the better way for you.
strogg
6-Jan-11 12:49pm
View
Let me know how exactly are you supplying the datasource to the report. Are you using ReportViewer.LocalReport.DataSources.Add()? Or you're using a binding source generated by the designer - some details would be helpful
strogg
7-Dec-10 13:50pm
View
Some very interesting links. Thanks!
strogg
3-Dec-10 9:21am
View
My vote of 5. That was a better solution. Had never took a look at CASE statements :)
strogg
2-Dec-10 12:33pm
View
As i said, i'm not used to using MFC. I strongly suggest that you take a look at some very good examples & study them carefully before planning what to do. The scribble sample, as suggested by john is an excellent one. It not only draws, but also demonstrates how to capture the graphics and save to & load them from a file.
You can find the source code for scribble at
http://msdn.microsoft.com/en-us/library/f35t8fts%28VS.80%29.aspx
strogg
21-Nov-10 11:26am
View
Whew! Good luck
strogg
21-Nov-10 8:59am
View
unfortunately you can only debug till the table fills up & send it to the report. But try some other tricks. Maybe your First() record may be blank? Try Last(Fields!...Value). You can also check the number of records actually received by the report with =CountRows(Nothing) or =Count(Fields!xxx.Value, Nothing). Better yet, add a table & drop a few fields from the troublesome tables to check.
& I'm running out of ideas ;-)
strogg
19-Nov-10 12:25pm
View
I dont understand. Should work especially if 'date' is String. All i can say is check for case & try in a new dataset / report maybe:
I wont be able to solve unless i see it :(
strogg
11-Nov-10 15:41pm
View
You cannot. If you want to, you must inherit from the class, filter and expose whatever properties you want.
strogg
11-Nov-10 0:35am
View
Thanks man. Also take a look at the extended window style WM_EX_TRANSPARENT (info in CreateWindowEx()). You might find it interesting
strogg
24-Jul-10 15:43pm
View
You're right - point noted :)
Show More