15,890,438 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 Member 15028314 (Top 21 by date)
Member 15028314
1-Dec-22 13:08pm
View
The function: RegCreateAddSetString, is a user built function. This function creates the item and fills it with a value.
Member 15028314
8-Aug-22 19:31pm
View
I've put together a "C" routine that builds a nice sized calendar with some features while writing it to a text file.
When completed, I edited the file just to look at it via MS-Notepad and it looked like garbage. Then I printed
it via MS-Notepad and it resulted in printed garbage. BUT when using NOTEPAD++ editor to look at them, the
calendars retained their shapes and forms, and then I printed them out using NOTEPAD++, their results were
spectacular. Included below is some C# printer code that I'm using to print out these text files, but their results
were garbage, they don't hold their form. How can this C# printer code be doctored/modified up to
perform/PRINT like NOTEPAD++, which produces some excellent results. The results being some excellent
calendar forms.
Any help would be appreciated. Again Thanks.
Aug 8, 2022
Member 15028314 - McGruff.
-----------------------
private void printbutton1_Click(object sender, EventArgs e)
{
int ierrcode;
errorline4.Text = "";
ierrcode = 0;
dofileactivitys( out ierrcode); //// pulling some edits.
if (ierrcode != 0)
{ //// the error section.
/// display an error message here.......
errorline4.Text = " Error Encountered in printing operations. ";
}
else
{
string filename;
filename = gstring;
Console.WriteLine(" *File: " + filename);
///Create a StreamReader object
reader = new StreamReader(filename);
///Create a Verdana font with size 10
verdana10Font = new Font("Verdana", 10);
///Create a PrintDocument object
PrintDocument pd = new PrintDocument();
///Add PrintPage event handler
pd.PrintPage += new PrintPageEventHandler(this.PrintTextFileHandler);
///Call Print Method
pd.Print();
///Close the reader
if (reader != null)
{
reader.Close();
}
}
}
private void PrintTextFileHandler(object sender, PrintPageEventArgs ppeArgs)
{
//Get the Graphics object
Graphics g = ppeArgs.Graphics;
float linesPerPage = 0;
float yPos = 0;
int count = 0;
//Read margins from PrintPageEventArgs
float leftMargin = ppeArgs.MarginBounds.Left;
float topMargin = ppeArgs.MarginBounds.Top;
string line = null;
//Calculate the lines per page on the basis of the height of the page and the height of the font
linesPerPage = ppeArgs.MarginBounds.Height / verdana10Font.GetHeight(g);
//Now read lines one by one, using StreamReader
while (count < linesPerPage && ((line = reader.ReadLine()) != null))
{
//Calculate the starting position
yPos = topMargin + (count * verdana10Font.GetHeight(g));
//Draw text
g.DrawString(line, verdana10Font, Brushes.Black, leftMargin, yPos, new StringFormat());
//Move to next line
count++;
}
//If PrintPageEventArgs has more pages to print
if (line != null)
{
ppeArgs.HasMorePages = true;
}
else
{
ppeArgs.HasMorePages = false;
}
}
------------------------------
Member 15028314
19-Jul-22 14:11pm
View
Hello OriginalGriff, I figured out my problem via my son, but I do not understand the answer why. My son told me to use notepad++, not MS-notepad, to see the actual calendar in month-form. I could see the month -calendars perfectly that I sent to a text file. And so I printed out a couple of months of the year, from notepad++, not MS-notepad. The output of NOTEPAD++ was excellent. Can you figure out why OriginalGriff?? And Thanks again...
Member 15028314
30-Jun-22 21:44pm
View
Hello OriginalGriff, it's been a long time since I have communicated with you. The problem I've been having is contained in a completed project(function). It is a small calendar that I blew up to a big size and added a few nice features to it. Of doing all of the programs that I am currently working, I have learned a lot on my own. I maybe soon sending the function to Patrica T., if she responds right.
Member 15028314
30-Jun-22 21:37pm
View
send me an quiet/not-known email address and I'll send you the code, but don't make the email known. Ok. I'm not one whom sends out their hard work to people to browse. But I'll do it. It was an idea I acquired off the Internet, and then I blew it up to its size, and added function call of my own to add features to it.
Member 15028314
25-Oct-21 11:30am
View
To Richard MacCutchan: OK Richard, we need to set the record straight on a few points...
1) I have been out of college for about 36 years.
2) While in college, I was a computer science major(not a business major) and I graduated with a B.S. degree.
So are you,
A) a flunky,
B) Do you have an AAS, or a B.S. or better?
C) You choose.
3) And definitely, this is not a school project. It came from ideas I learned from out in industry.
More over, where do you get off playing god on/from a distant keyboard - claiming you are better
than other people/person, and that you know all!
I have been working on this project for a long time. It went from being VB/"C"/DLL project to
C#/"C"/DLL project.
4) I write for no one else!.
5) You sure do read between the lines, making a lot of a false assumptions.
6) Just to add a little understanding to that little frame of mind, I learned C# from examples, working
at that. I do not claim to know C# like I should. But thru using working C# examples and trying
different things out, I've done a lot on my project, and it has come a long ways.
7) So don't come across as an all-knowing individual, claiming you know all the information neccesary to
make a snap decision - which usually is false.
This all started when I stated some correct and true facts about someone who wanted a new language parser
built Yet he/she had not stated nor shown nor indicated any initial work or even provided some effort
had been provided. And I directly said, that individual was lazy and the he/she should get off their little
caboose and start working.
Is taking the truth to hard to take or swallow? So my two-bits worth to Richard MacCutchan is to get up off
your lazy caboose and learn the facts first and stop making a lot of a false assumptions - thinking that you are
all knowing and high and mighty - of which you are NOT! I hate being put down and being belittled.
KNOW the facts first. ALL I want is some help, Please...
As in a western movie, one gunfighter is calling you out. I want to know if you are going to SHOW or BLOW?.
McGruff
Member 15028314
24-Oct-21 19:40pm
View
A comment please... Within this website, it was mentioned that I should set the c# application's environment
and windows dll application's environment, each to the release/x86 mode.
I did it, and my c# program and my windows dll file routines communicates quite well. Yet we still have problems.
Yet many times before, I was able to have my C# program call a bunch of DLL "C" routines to perform many
different process conversions. Much over a 100 different conversions, to say the least. Now, I can only run less
than 61 contiguous process', otherwise the C# program just silently abends and disappears. Are there any "C" call
layering restrictions or what?? I know the "C" routines work, cause they have proformed themselves excellent
before. Are there still other C# and "C" hidden caveats that I don't about?
Any suggestions? cause I'm lost for words.
McGruff...
Member 15028314
18-Oct-21 1:33am
View
OOkay OriginalGriff, thee original question(at the top of this page) that
you referenced was about someone who wanted to glory from somebody else's work,
because he/she didn't want to up get off their caboose and put forth the
required effort. He/she is quite lazy! The way you act and interact with people,
whom may not have the knowledge you have, shows that you have a lot to learn
about working with people. As for being from the old college, I've learned
Cobol, Algol, Pascal at college, and Fortran, "C", C# on my own from working
examples and have done quite well in college and on my own. And I've recieved
some good grades for it from a big US university.
And yes, I even have a big C# project too with problems that I can't solve, so I
came here for help. And yet, people come here in all shapes and with limited
knowledge; and maybe they don't know how to fully express the problem(s)
at hand or even understand the answer(s) given. Maybe they even have a
diability issues that you don't even know about that may affect them in some ways,
but they try anyway to achieve success in any way they can. From someone of
the old college, you need to take people for who they are, and don't you dare
look down on them. Weren't you once in a learning state at many times,
wanting to learn/know more, and trying to fix a programming problem or
problems. So now, as was said before, show or blow - in showing a little a
compassion in working with whom needs some help, and not act like someone
whom is almighty at the keyboard. If you "blow", I feel quite sorry for you.
But if you 'show', you have a lot of potential, cause you have a lot to learn
about people, and can have success in other ways of helping.
** McGruff ** RSVP, I call.
Member 15028314
11-Oct-21 0:17am
View
I do offer Apologies for my rudeness and other bad traits. Sorry.
Member 15028314
11-Oct-21 0:07am
View
So OriginalGriff, you ask what help would I give on a big project that hasn't been started? None. No workable effort has been shown. Sigh... What are you baiting me for?? If you have a secure site/place/connection and neutral, I'll show you my big project that I've worked on for so long, and I'll show you some effort. So, if I may say and ask it kindly and gentely, now show or blow. I think this is what you are baiting me for.
Member 15028314
8-Oct-21 0:56am
View
Yes, my "C" functions send and receive data and even modify
char, ints, real, and bool data. Cause that's what they're built for.
SO avoid Stringbuilder, and strings. Hum... Ok, now what? I'm still looking
for the correct C# calling conventions that calls "C" routines, that allows me
to send and receive a variety of data types. Such as (*)char *, ints, reals, and
bools information. My two big projects are sitting idle. I need some solid
examples showing me what needs to be done. Cause if I run it release mode, my
program runs and then abends when it feels like. Which is not very good. Do
you know of any persons who has the knowledge that I'm looking for. For C#
to call many DLL "C" routines? I'd appreciate any solid help.
(*)- char * datatypes. Not strings. RSVP, Thanks. Thanks for fast initial response.
Member 15028314
6-Oct-21 23:31pm
View
Okay, OriginalGriff: A teacher would say, have you done anything?? Show me. This is like asking a college professor for an "A", when you have not done anything to warrant a grade of "A". So, if you want it bad enough, better start producing the lexical analyizer, and symbol table setup, and the startings of a new language parser, We/I would think about some help.
Member 15028314
5-Oct-21 23:44pm
View
These solutions presented here, don't even come close in answering the initial
question asked, none of them. It reminds me of my compiler construction class,
where I went to college. To implement a parser, you need to start at square one.
First, write a lexical analyzer, then a symbol table, and then a parser, and then
I believe there are a few more major phases left to build and implement. The
first two steps aren't to bad to write, but the parser phase is a real challange to
write. So the owner of this initial question better get his little caboose running
down the track. You have state/next-state table(s) to construct. Correct syntax
grammer better fit/follow the state/next-state tables. Also, include syntax/grammer
error detection. With making these tables, you are going to be drawing lines all
over the place. That's all my little brain remembers, but it takes times and
patience, and not asking anybody else to do your school work. Parsers are not
built overnight.
Member 15028314
6-May-21 16:24pm
View
Again, I'm working on two approaches that I'm on. Each approach has an error; that I do not understand. Error #'s: 1501 and 1503.
I'm to get both approaches working and then determine which one is best to use. So, which one is best to use??
Here they are:
var EnumOptns = new EnumerationOptions();
Approach one:
var dirInfo = new DirectoryInfo(searchDirectory);
String[] dirsx = dirInfo.EnumerateDirectories(searchstring, EnumOptns);
///// "EnumOptns" is underlined only.
///// With Error CS1503 Argument 2: cannot convert from 'WindowsFormsApp10T.EnumerationOptions'
foreach (String stfs in dirsx) {
---------------------------
Approach two:
String[] thefiles = System.IO.DirectoryInfo.EnumerateFiles(searchDirectory, searchstring, EnumOptns);
//// "EnumerateFiles" is underlined only. There are 3 arguments present.
//// With Error CS1501 No overload for method 'EnumerateFiles' takes 3 arguments.
foreach (String stfs in thefiles) {
------------------------------
var EnumOptns = new EnumerationOptions();
I do have an EnumerationOptions.cs file.
Contents:.....
namespace WindowsFormsApp10T
{
/////public static System.Collections.Generic.IEnumerable<string> EnumerateFiles();
internal class EnumerationOptions
{
public EnumerationOptions()
{
RecurseSubdirectories = true;
IgnoreInaccessible = true;
}
public bool IgnoreInaccessible { get; set; }
public bool RecurseSubdirectories { get; set; }
}
}
=======================
What am I doing wrong?, I know I'm close though.
Can anyone help me get these two approaches working? .
Thanks though.
Member 15028314
5-May-21 21:36pm
View
Please provide solid working examples, to support your suggestion(s).
Member 15028314
29-Apr-21 19:27pm
View
My comment, Hum?? I'm sorry, but seeing is believing. I believe I need to see this in action first!; before passing judgement. Okay?
Member 15028314
19-Apr-21 19:12pm
View
Ok Gerry and Rick: I'm of the old college, I have also written many fortran 77 programs implimenting and using random access files on a DEC vax/vms 11780 at school and professional work. I also written cobol programs using an ISAM methods also. Hum?
Member 15028314
19-Apr-21 1:44am
View
Sorry Gerry, you speculating.
Member 15028314
30-Mar-21 22:36pm
View
Ok BillWoodruff, what is going on! I did explain everything that had happened in the question in detail. I stated that I would email the code that I am using via a valid email address. I'm not willing to divulge what I've done to the watching/viewing public. I'm willing to do my part, but not go and do a massive program search thru massive amounts of C# code while you make me do everything. On one question, I worked with
OriginalGriff on a question and I did what I could on my part. I had the program with errors that I was willing and offering to send via a valid email address(showing my effort/part). And with OriginalGriff's help and with what I had to do, things worked out quite well. I despise working someone whom thinks I have not done the/any work nor explained the situation at hand. It's like you're playing GOD, and making me
do all the work. You need to review the question that I asked; again! And in there(the question), I have explained the situation that I'm facing. The phrase that you do not understand is that when my webview2 program came up, the end results(the webview2 window) was/looked awesome and neat. So I deleted all my other C# linklabel code soon thereafter, cause the C# linklabel code was not working the way that I wanted it to do. I did
explain the situation at hand. I explained the visual end results, and the final visual end results of attempting to close the webview2 window -- which is the situation that I'm trying fix. So, if I may say it gently, getdown off your perch of authority and overbearance, and help in an understanding and kind way - from someone whose
from the old college who wants to learn. Okay? Please? If you are a true moderator, you do have access to email address' and names thereof. So, please, I'd appreciate some help. Thanks, RSVP Please...
Member 15028314
Member 15028314
22-Mar-21 23:46pm
View
OK Maciej Los, All I was doing was re-editing the question. The web page gave me the option to so.
Member 15028314
25-Dec-20 12:14pm
View
OK. But, isn't there some clarifying switch(that exists) that tells whether it's an installed package or a valid user. There's got to be one; it can't let you hang like this. Any examples???
Show More