 |
 |
Index ‹ Visual Studio ‹ Visual Basic
|
- Previous
- 1
- 2
- MFC >> button controlhi all,
i'm developing an SDI application by eVC++.
now in the CView, i created a button object.
when i received a click on the button .
i want to notify back the CView to update the screen.
how can i do that?
thank you.
- 3
- Mcse >> joining for microsoft news groupshello
i m a student of MCSE and i want to join your news
groups. Please send me a mail in my mail account after
accept this aplication.
Regards,
Thanks
M.IRFAN ANJUM
- 4
- Mcse >> CertGuard - Info?Hi IT Community,
I decided to do some research on this so called www.certguard.com. I
see post over post about these braindumps. Well, let me tell you
something, I have done some extensive research on this CertGuard
company and I warn everybody to make a decision for themselves on this
company. CertGuard claims to watch for companies that state you will
pass on your first try, any company that offers 100% Pass Guarantee
and not a 100% Money Back Guarantee, what is the difference? There is
no difference. What seems to be really funny is that my best friend
ordered off transcender.com the so called (Reader's Choice Award) and
found their questions to be identical to the real exam. So, where does
CertGuard go off stating that www.transcender.com and other sites
listed on there website are clean when in fact they are not. Every
single vendor out there put's real if not very very similar exam
questions related to the real exam. You can view the list of the so
called CertGuard's clean list below:
http://www.certguard.com/reviews.asp
Now, you see many companies listed here: "Wonder if these companies
are paying for this?"
Now, let's look at www.transcender.com the so called (Reader's Choice
Award) winner. Which many many people have stated that in fact they do
provide the exact questions on there products.
According to Certguard.com, CertGuard states to stay away from the
below websites that state the below:
i. Every website that is owned by TestKing provides braindumps. Yes,
it's that obvious! If just ONE of TestKing's websites provides
braindumps, ALL of them do.
ii. Sites that advertise 'Actual Exam Questions & Answers' are most
likely passing off braindumps.
iii. Sites that offer a '100% Pass Guarantee on the FIRST try' (most
legitimate sites will offer a Money Back Guarantee, but this is
completely different than guaranteeing you a passing score.) Make sure
you read their Disclaimer before you jump into any commitments. OR
ASK
US!!!!
iv. Access to ALL of their practice exams for X number of dollars is
another sign of a braindump, no legitimate corporation can afford to
just give away their material for next to nothing. We've seen
legitimate practice exam run for as little as $40 or as much as $300
per exam, but we've never seen a legitimate site offer ALL of their
Exams in a bundle for such a cheap price.
v. Legitimate Practice Exams will generally cost around $100 per CD
(or Exam), unless the Test Prep provider is offering a discount, but
even then the kits are no less than $50 per CD. If you're looking at
buying a bundle of exams for that price, then you're almost sure to
be
purchasing braindumps.
vi. PDFs!! Not every PDF is a braindump, and not every braindump is a
PDF, but the odds of getting a PDF that isn't a braindump is pretty
rare. DON'T TRUST PDFs!!!
Well, looking at www.transcender.com, I found the below:
Furthermore, you can view more about there guarantee below:
http://www.transcender.com/guarantee/
They will refund your purchase the first time if you fail. Now this is
just one of the sites I picked on CertGuard's so called clean list.
Click also the link below:
http://www.transcender.com/dept.aspx?dept%5Fid=100000
You will see an image with a guy jumping with his leg's open, Read
what it states:
You will Pass the First Time Guarantee. End Of Discussion. (This is
the exact wording used on jrksoftware.com, another well known
braindump provider)
Proof backing up my claim on transcender. Please click the below posts
in newsgroups made by people ordering from transcender.
http://groups.google.ca/group/microsoft.public.cert.exam.mcad/browse_thread/thread/4740b2d9d62ca55c/a282ee8503baa62f?lnk=st&q=transcender+real+questions&rnum=3&hl=en#a282ee8503baa62f
Below is also another post from David Mickelson stating that Microsoft
does not support transcender.
http://groups.google.ca/group/microsoft.public.cert.exam.mcsd/browse_thread/thread/84123cf7f578717f/4fa05c8d04b0b552?lnk=st&q=transcender+real+questions&rnum=5&hl=en#4fa05c8d04b0b552
The link below is another post you can view on transcender's from the
user Coffee.
http://groups.google.ca/group/alt.certification.mcse/browse_thread/thread/fc929f997a2cbc7b/07825e55337c8266?lnk=st&q=transcender+real+questions&rnum=6&hl=en#07825e55337c8266
I can add more and more posts on this subject regarding Transcender
but I will stop here, you can do this research yourself, but I warn
you, watch for transcender staff trying to convince you otherwise on
the newsgroups.
To make a long story short, no one really knows if CertGuard is
getting paid off, only they know. It is so funny on how they defend
websites that they state are clean when people who have actually
ordered from those sites state otherwise.
My opinions are expressed below on the whole topic of braindumps and
CertGuard: Please feel free to comment on this.
1. Braindumps don't hurt the IT industry. The Hiring Managers
Incompetence is what is Hurting the IT industry. What's hurting the IT
industry are incompetent hiring managers. When hiring IT staff, it is
up to the employer to determine the applicant has the necessary IT
skills and knowledge to perform in their job to back up their
certification, and not just assume they do simply because they are
certified. People who use braindumps and just plain memorize questions
are easily detected by any competent hiring manager during the first
interview.
For example, if we were to compare 2 candidates with a CCNA
certification being interviewed for the same job, and lets say one
studied via CCNA instructor led classes and books, and the other
simply braindumps. During the first interview, the hiring manager
would surely ask the candidates some technical questions based on
their CCNA assumed knowledge and skills like describe the OSI layers
and their functions or something like this. The candidate that only
memorized the braindumps to pass the exam would not know how to reply
where as the candidate who studied hard would easily be able to answer
the question.
I know when I was interviewed for my job, I was tested on configuring
a Cisco router with NAT, also doing an IOS upgrade on a router, and
configuring MPLS on the router. I passed but the manager took extra
steps to ensure that I did indeed know what I was talking about. So,
what I am saying is to educate managers and companies to test there
employee's instead of just assuming that they are good.
2. CertGuard looks to me to support braindump sites, and possibly has
a financial interest in their supposed clean list of sites it
supports. CertGaurd clearly offers only biased information so take
everything you read from any of them carefully, in fact, I would not
trust them at all!
Reasons they are exploiting the IT industry is because they clearly
state certain sites are clean when any newbie to this industry can
tell they are not, and also because they are profiting from selling
advertising space on their website all in the name of their bogus war
on IT Braindumps and cheaters.
How do we know if any of them are actually certified? How did they get
their certifications? Maybe they bought them from testking? How can we
trust a group of online posters who seem to use Nazi-Like rhetoric and
Communist type phrases? Don't take my word for it, just check any of
their posts and you will surely see this to be the case.
Clearly, by simple investigation anyone can see that many of the sites
Certguard supports are Braindumps ie. QuickCert.com, Trancender.com,
Certways.com, jrksoftware.com etc...
Could it be possible that Certguard is receiving some form of
financial compensation for their support of these known braindump
providers? I would have to say yes since their War on Braindumps etc..
is simply an exploit of this issue for financial gain as they are
selling advertising on their website.
As we all know, if something sounds too good to be true, it usually
is. This has been my experience specifically with Certguard. At first
glance, I thought, finally, someone who will actually do something to
clean up the IT industry, but after really looking into their website,
it seems 100% clear that they have a financial interest in this so
called War on Braindumps. I would like to suggest that Robert Williams
rename this war to "My War Against Braindump Sites I Am Not Profiting
From!" because clearly as you will see below, many of the sites listed
on his bogus clean list are actually well know braindumps sites which
are probably paying him:
- QuickCert.com - They Claim this site is clean:
http://www.certguard.com/forums/topic.asp?TID=450
Clearly, this site is not clean because they have a direct link from
certifyexpress.com, braindumpcentral.com, braindumps.com, which
Certguard knows is a Testking owned website and a well known braindump
promoting site as you will see below:
On the homepage of certifyexpress.com, you will notice the very top
banner advertising for Testking.com, then the one just below it
advertising for Quickcert.com, and then there are 3 links for Actual-
Exams.com, Testking.com and you guessed it, Quickcert.com. Clearly,
you cannot dispute this evidence and clearly, certguard must have some
financial interest in promoting quickcert.com.
Here is another list from a CertGuard post which lists Braindump free
sites: http://www.certguard.com/forums/topic.asp?TID=270 out of this
list, there are clearly well KNOWN braindump sites like:
Certways.com - a well known braindump site most likely owned by
Testking with hosting on the same server as:
- Examways.com
- Examworx.com
jrksoftware.com - a longtime braindump provider using the EasyCert
name their homepage clearly states "you will pass the first time
guaranteed! In the left menu bar with a pic of a girl jumping for joy.
A simple backlink check will show that they have an incoming link from
Examblasters.com, which is also another braindump site:
http://www.google.com/search?q=link:http://www.jrksoftware.com/&hl=en&start=10&sa=N
gocertify.com - they claim to be clean, however they have a link on
their site for Practice Tests with goes to goexam.com which seems to
be their cover to sell braindumps with a Pass Guarantee and 25% - 50%
off their products.
Transcender.com - They provide a Pass on Your First Try Guarantee and
practice tests that contain actual exam questions. I know this
firsthand as my best friend used their material about 1 year ago and
found this to be the case. Surely not clean and also seems to have an
affiliate as listed next.
studyexam4less.com/transcender.asp - They also provide braindumps and
are well known to be doing this for some time now. They even have
their own page outlining the 100% Pass Guarantee here:
studyexam4less.com/Transcender-Pass-the-exam-the-first-time-
Guarantee.asp
certsavvy.com - offers a Pass the First Time Guarantee and is known to
provide real exam questions
3. CertGuard is Childish, Immoral and Useless.
They seem to always provide Useless info and no help for newcomers to
the IT industry and often end up insulting and or threatening your
legitimate beginner questions. CertGuard doesn't seem like a group of
people I would trust with my career choices so be very careful and
think for yourself.
Here is a perfect example of what I am talking about:
Post Topic: What requirement for MCSE
The First Guy posts about the requirements for MCSE but no one other
than Birol gives a useful reply. Cerebrus (who works for certguard)
and Certguard both give useless, insulting replies and also show just
how childish and immoral they are, so how could any one trust what
such rude and immoral people say, without doing their own research:
http://groups.google.ca/group/microsoft.public.cert.exam.mcse/browse_thread/thread/898b840717f20934/61957239a6843f67?lnk=gst&q=certguard&rnum=106&hl=en#61957239a6843f67
I would never ever trust my career choices with anything these animals
say. They are basically wolves in sheeps clothing, trying to make a
buck all while not helping and rudely poking fun at anyone that comes
into their path!
And if you think I am making this up, just check any of their posts
and you will surely see their wolf like attitude speak out loud:
This is in addition to what Larry J West has stated about certguard
for which I agree 100%:
http://groups.google.ca/group/microsoft.public.cert.exam.mcdst/browse_thread/thread/b913082dda4522e6/a6dd48bde6adf5f1?lnk=gst&q=certguard&rnum=76&hl=en#a6dd48bde6adf5f1
Larry States:
"You are right that many in the MCNGP / CertGuard group are very
childish, rude beyond belief, and in most cases [90% of the time] not
very helpful. Their insulting of people for no reason who are trying
to help people is truly beyond my comprehension, especially since
these are people who are supposedly knowledgeable enough on computers
to know that UseNet exists (Not everyone does) and hence have some
intelligence.
So why did you join them? I think their group's goals of stamping out
proxy-testers and braindumps is very laudable, but their actions are
just like the outgoing Clinton officials
glueing of the "W" keys on government computers - it doesn't show any
intelligence, it just shows how childish they are and destroys what
credibility they did have. This is a PUBLIC forum - their actions may
be fine in their fraternity houses on their college campuses, but not
in the real world. Their response to you in not acknowledging that
this is a problem (but just criticizing you further) is another sign
that they are ignorant and do not understand or care. Until they
change, I will not be joining that group, which is a shame, since I
too agree with cleaning up the certification mess."
Even the criticism of you putting your "MCP" in your signature is a
sign that some in the group's leadership deep down don't care about
increasing the values of all certifications. They just want to justify
their psychological need of putting people down and somehow believe
that this is a good method of doing so.
I would like to know why you gave them credibility for their actions
by joining their group.
4. CertGuard Is not to be Trusted?
Just read any of their posts and replies and you will certainly agree
that they are offensive, rude, not willing to help and in the end,
fraudulent as they claim to provide support for clean sites when they
actually support braindump type sites.
5. CertGuard should issue a War on Incompetent Managers. But there is
no financial gain in doing that! It is 100% up to the hiring manager
to weed out unqualified applicants, in reality, no one cares about
braindumps. Because there is no financial gain in this reality,
certguard will never come to grips with this and seems to continue to
pursue their fake war on cheaters!
These are just my opinions made by facts and observations that I have
seen and listed with regards to Certguard.com. You make you own
decision?
I have listed posts below that you can view and see for yourself on
this so called CertGuard company:
1. Many arguments that CertGuard may be covering and providing
braindumps:
http://groups.google.ca/group/microsoft.public.cert.exam.mcse/browse_thread/thread/5d98421a377bcb3b/9a3a6262b88ed1b1?lnk=st&q=certguard&rnum=2&hl=en#9a3a6262b88ed1b1
2. Exams Required for MCSE -> LarryWestMCSD (5th post down) states
that CertGuard is childish, rude and most of all not helpful. This is
exactly what we want to say about them in addition to their support of
apparent braindump sites and exploiting this War on Braindumps for a
profit via website advertising. Below is a quote taken from this post.
http://groups.google.ca/group/microsoft.public.cert.exam.mcdst/browse_thread/thread/b913082dda4522e6/a6dd48bde6adf5f1?lnk=gst&q=certguard&rnum=76&hl=en#a6dd48bde6adf5f1
"You are right that many in the MCNGP / CertGuard group are very
childish, rude beyond belief, and in most cases [90% of the time] not
very helpful.
Their insulting of people for no reason who are trying to help people
is truly beyond my comprehension, especially since these are people
who are supposedly knowledgeable enough on computers to know that
UseNet exists (Not everyone does) and hence have some intelligence. So
why did you join them?
I think their group's goals of stamping out proxy-testers and
braindumps is very laudable, but their actions are just like the
outgoing Clinton officials glueing of the "W" keys on government
computers - it doesn't show any intelligence, it just shows how
childish they are and destroys what credibility they did have. This is
a PUBLIC forum - their actions may be fine in their fraternity houses
on their college campuses, but not in the real world. Their response
to you in not acknowledging that this is a problem (but just
criticizing you further) is another sign that they are ignorant and do
not understand or care. Until they change, I will not be joining that
group, which is a shame, since I too agree with cleaning up the
certification mess.
Even the criticism of you putting your "MCP" in your signature is a
sign that some in the group's leadership deep down don't care about
increasing the values of all certifications. They just want to justify
their psychological need of putting people down and somehow believe
that this is a good method of doing so.
I would like to know why you gave them credibility for their actions
by
joining their group. "If you would like to read more about this post,
you can view this by clicking on the link below.
3. Transcender Vs. MeasureUp -> the majority of posts here doesn't
even cover this topic, instead it is filled with childish and useless
posts.
http://groups.google.ca/group/microsoft.public.cert.exam.mcse/browse_thread/thread/898b840717f20934/61957239a6843f67?lnk=gst&q=certguard&rnum=106&hl=en#61957239a6843f67
4. What requirement for MCSE -> First Guy posts about the requirements
for MCSE but no one other than Birol gives a useful reply. Cerebrus
and CertGuard both give useless, insulting replies and also show just
how childish and immoral they are, so how could any moral person trust
what they say without their own research:
You can view this post below:
http://groups.google.ca/group/microsoft.public.cert.exam.mcse/browse_thread/thread/6586f7bd9e0c052/77d52a5acbd78c0d?lnk=gst&q=certguard&rnum=121&hl=en#77d52a5acbd78c0d
I can go on and on but I think I will stop here. Please feel free to
post with regards to this information provided and give your views on
this topic. Once again, this is just my opinion that certguard
actually supports certain websites that provide braindumps and I hope
people don't get fooled by this.
Cheers!!!
- 5
- Visual Basic [VB] >> Extracting Parts of a StringHello,
I have a question about manipulating string in VB.NET2003.
I have a string that looks as follows:
MyString = "1st garbage blah, blah.. " & vbCrLf & _
"==============================" & vbCrLf & _
"2nd garbage blah, blah.. " & vbCrLf & _
"==============================" & vbCrLf & _
"3rd garbage blah, blah.. " & vbCrLf & _
"------------------------------" & vbCrLf & _
"4th garbage blah, blah.. " & vbCrLf & _
"------------------------------" & vbCrLf & _
"5th garbage blah, blah.. " & vbCrLf & _
"------------------------------" & vbCrLf & _
"6th garbage blah, blah.. " & vbCrLf & _
"------------------------------" & vbCrLf & _
"7th garbage blah, blah.. " & vbCrLf & _
"------------------------------" & vbCrLf & _
"8th garbage blah, blah.. " & vbCrLf & _
From this string, I would like to get rid of the all the separator
lines shown below:
"==============================" & vbCrLf & _
"------------------------------" & vbCrLf & _
And make a new string that contains the contents of MyString without
above two lines. Like this:
NewString = "1st garbage blah, blah.. " & vbCrLf & _
"2nd garbage blah, blah.. " & vbCrLf & _
"3rd garbage blah, blah.. " & vbCrLf & _
"4th garbage blah, blah.. " & vbCrLf & _
"5th garbage blah, blah.. " & vbCrLf & _
"6th garbage blah, blah.. " & vbCrLf & _
"7th garbage blah, blah.. " & vbCrLf & _
"8th garbage blah, blah.. " & vbCrLf & _
I been digging String methods for a while but have no idea how I can
do this operation.
Can anyyone give me an idea as to how to do this operation?
Thank you very much in advance!
- 6
- VB Scripts >> excel spreadsheet object for ASPDoes anyone know how to add a graphic to a hyperlink in
the spreadsheet control for ASP.
I know how todo this in excel using a picture and creating
a hyperlink on it.
But how can I do this in the control?
is this doable?
thanks!
- 7
- Visual Basic [VB] >> A value copy, not reference, of SqlParameter?' Declare a new parameter object
Dim param() As SqlParameter = New SqlParameter(0) {}
' Set this to null and make it an InputOutput parameter
param(0) = New SqlParameter("@Something, DBNull.Value) ' Can also be
non-null, but sometimes is null
param(0).Direction = ParameterDirection.InputOutput
' But, before we begin, store a copy of the existing parameters into another
variable
Dim param2() As SqlParameter = New SqlParameter(0) {}
param2 = param
' Run the stored proc. The stored proc has an OUTPUT parameter which will
return a value to the caller
SqlHelper.ExecuteNonQuery("ConnStr", CommandType.StoredProcedure,
"dbo.MyStoredProc, param)
WHERE
MyStoredProc's @Something parameter is an OUTPUT parameter, and after the
stored proc is finished running, BOTH SqlParameters have the same value.
It looks like "param2 = param" is a reference copy. How can I copy by value
only so that, when the Output argument returns a value to the first
parameter, param2 does NOT have the same value. I want a value copy, not a
reference copy. How do I do that?
- 8
- MFC >> Clipping Regions (Rects)Hi guys,
I'm making a CWnd-derived control, kinda like a CListCtrl, and I'm starting
to get a headache when it comes to partially displayed rows. So I was
thinking, should I just create a rectangular clipping region and let it do
the dirty work ? Will it be a lot slower ?
I made a DrawItem() that has three cases:
1) draw the whole row
2) the top part is clipped off
3) the bottom part is clipped off
And it would be a hell of a lot easier if I just made a clipping rect and
drew the whole row. I guess I can put in the extra effort but what do I gain
? Thanks.
- 9
- Visual Studio C++ >> Scope of using namespaceHi,
The following code compiles with no error on VC7.1, however I am told
that it produces an error in GCC 4.0 and that, according to the standard
it should indeed produce an error that C1 is not accessable from foo().
Could someone with access to VC8.0 check out what the behaviour on this
compiler is?
namespace N1
{
class C1
{
public:
void f1() {}
};
}
namespace N2
{
using namespace N1;
class C2
{
C1 c;
void f2();
};
}
void N2::C2::f2()
{
C1 c;
c.f1();
}
void foo()
{
C1 c;
c.f1();
}
- 10
- MFC >> oleacc problemhello!
i written apllication (Visual Studio .NET 2002) and have to launch it with
XP Embedded. when i try to start the application system error message "DLL
oleacc.dll not found" appears. i've attempted to use DELAYLOAD linker option
but it hase no effect. i attempted to use oleacc empty library, but have
received a message "access violation @0 read address 0".
i not used accessibility tools. is it possible to build the program without
using of oleacc.dll? thank you!
- 11
- VB Scripts >> Adding TCP/IP Printer Ports and Drivers using a login scriptI've written a script to automatically add tcp/ip printer ports and drivers
based on the user's subnet. The script works fine as administrator or power
user however it will NOT work properly if the user has standard user rights.
I need some assistance working around this. I realize that I could use WMI
to do impersonation and add these ports and drivers. However, due to the
large size of the script and the fact that changing methodologies to WMI
would add probably 20+ lines of code per printer per function, there are 100+
functions with anywhere from 2-15 printers per branch function, I can't
realistically change. I'm using the prnport.vbs and rundll32 printui.dll
methodoligies to accomplish what I need. I've tried to build runas into the
script even passing credentials automatically and it still doesn't work
right. My inclination is that the rundll32 must run under an explorer
session that has admin or power user rights otherwise it fails with not
enough rights. Below is a sample of the code. Any help you can provide
would be great!
Dim oIP, r
On Error Resume Next
oIP = DefaultGateway
Select Case oIP
Case "10.207.127.1"
Set oShell = WScript.CreateObject("WScript.Shell")
r = oShell.RegRead("HKLM\SOFTWARE\Printers\judesk\Installed")
If r <> 1 Then
AddPrintersjudesk
End If
End Select
Function DefaultGateway()
Dim oDG, oDGs, WMI
Set WMI = GetObject("winmgmts:\\.\root\cimv2")
Set oDGs = WMI.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each oDG in oDGs
If Not IsNull(oDG.DefaultIPGateway) Then
If Not oDG.DefaultIPGateway(0) = "0.0.0.0" Then
DefaultGateway = oDG.DefaultIPGateway(0)
Exit For
End If
End If
Next
End Function
Function AddPrintersJUDesk()
'prndriver1 = """QMS ColorScript Laser 1000"""
'prndriver2 = """Kyocera Mita FS-3700"""
prndriver3 = """IBM InfoPrint 20"""
'prndriver4 = """HP LaserJet 4"""
'prndriver5 = """SHARP AR-M277 PCL5e"""
prndriver6 = """Kyocera FS-5900C (KPDL-2)"""
'prndriver7 = """HP LaserJet 5Si"""
'prndriver8 = """HP LaserJet 4100 PCL 5e"""
oShell.Run "cmd /c cscript c:\windows\system32\prnport.vbs -a -r
IP_172.18.102.10 -h 172.18.102.10 -o raw -n 9100"
oShell.Run "cmd /c rundll32 printui.dll,PrintUIEntry /if /b P6154001 /f
%windir%\inf\ntprint.inf /r IP_172.18.102.10 /m " & prndriver1
oShell.Run "cmd /c cscript c:\windows\system32\prnport.vbs -a -r
IP_172.18.102.11 -h 172.18.102.11 -o raw -n 9100"
oShell.Run "cmd /c rundll32 printui.dll,PrintUIEntry /if /b P6154002 /f
%windir%\inf\ntprint.inf /r IP_172.18.102.11 /m " & prndriver1
oShell.Run "cmd /c cscript c:\windows\system32\prnport.vbs -a -r
IP_172.18.102.14 -h 172.18.102.14 -o raw -n 9100"
oShell.Run "cmd /c rundll32 printui.dll,PrintUIEntry /if /b P6154003 /f
%windir%\inf\ntprint.inf /r IP_172.18.102.14 /m " & prndriver1
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Printers"
strKeyPath2 = "SOFTWARE\Printers\judesk"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath2
strValueName = "Installed"
dwValue = 1
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeypath2,strValueName,dwValue
End Function
- 12
- Visual Studio C++ >> How can I make my subclass get the WM_DRAWITEM and WM_MEASUREITEM message?Hello, All:
I had wroten a programme which should redraw a CListBox and CListCtrl class,
But so strange, when I drag an object into a CDialog object, and setting a
member value to relate with the CListCtrl(or CListBox),then I changed the
member value's type into CMyListBox( or CMyListCtrl), By this time,I thought
it must can access the function which I inherited from the CListBox( or
CListCtrl),but I cannoot see my
void CMyListCtrl::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT
lpMeasureItemStruct)
and
void CMyListCtrl::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
were be called.
However, I found there's 3 types of different WM_DRAWITEM and
WM_MEASUREITEM's reaction function from the ClassView's "Add Window Handle",
I am not sure whether there's any different with them all.
Up till now, I think maybe there's something wrong with the CListCtrl's
type. Is there anybody who knows whether there's any problem with my
programme?And I also wanna get how different with these 3 types of
WM_DRAWITEM and WM_MEASUREITEM's reaction function.
The following is apart of my programme:
////
// TestDlg.h
///
class CTestDlg : public CDialog
{
// Construction
public:
...
CMyListBox m_ListBox;
...
}
///
// TestDlg.cpp
///
BOOL CTestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
...
m_ListBox.AddString("FD");
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
///
// MyListCtrl.h : header file
//
class CMyListCtrl : public CListCtrl
{
...
protected:
//{{AFX_MSG(CMyListCtrl)
afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT
lpMeasureItemStruct);
afx_msg void OnInsertitem(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
//}}AFX_MSG
...
}
//
// MyListCtrl.cpp : implementation file
//
BEGIN_MESSAGE_MAP(CMyListCtrl, CListCtrl)
//{{AFX_MSG_MAP(CMyListCtrl)
ON_WM_MEASUREITEM()
ON_NOTIFY_REFLECT(LVN_INSERTITEM, OnInsertitem)
ON_WM_DRAWITEM()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
////////////////////////////////////////////////////////////////////////////
/
// CMyListCtrl message handlers
void CMyListCtrl::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT
lpMeasureItemStruct)
{
// TODO: Add your message handler code here and/or call default
CListCtrl::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
}
void CMyListCtrl::OnInsertitem(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
*pResult = 0;
}
void CMyListCtrl::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
// TODO: Add your message handler code here and/or call default
CListCtrl::OnDrawItem(nIDCtl, lpDrawItemStruct);
}
Thanks in advance!
- 13
- 14
- VB Scripts >> InternalNameDoes anyone know how I could echo back a internal name of an dll or exe
file? I found this link:
http://www.nedcomp.nl/support/origdocs/dotnetsdk/cpref/frlrfsystemdiagnosticsfileversioninfoclassinternalnametopic.htm
, but its for Visual Basic, C#, JScript only, and I can't figure out
how I would do it in vbscript.
- 15
- MFC >> Bad Web LinksI have a problem on one particular computer in France. In researching the problem, I thought that the bug was related to the problem reported in
http://support.microsoft.com/default.aspx?scid=kb;en-us;30560
This page isn't really dated but was last checked 9/2003
The page also allows downloads of the patch. For English Windows 2000, it leads to page
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=6D5E05E6-2D13-4FE7-B322-DFBF1B4589C
which is dated 11/2001. The description on the page does not match the first page, either
Now, the original problem is fixed in Visual Studio 6.0, Service Pack 6 which wasn't released until 3/2004. Service Pack 5 was released in 2000. (At least the Readme's file list doesn't seem to list anything past 2000.) I'm guessing that the first file was generated in 2003, and does not link successfully
Since our problem is not related to this problem (further testing proves that formatting floats isn't crashing us, but I don't know what is crashing us at this point) it does not really affect me, but I would like the ability to download the new MSVCRT DLL on a non-development machine
Thanks
Terry
|
| Author |
Message |
mickmack

|
Posted: Wed Jun 20 11:51:36 CDT 2007 |
Top |
Visual Basic >> Program Version Number
In Project Properties in Version Number I see: Major 12, Minor 1, Revision
10.
When I compile my project and via EXE's properties I see Version 12.1.0.10
Where 0 does come from?
Is there any place in VB environment to control that third place in version
number? Now it's always 0.
Thank you
vovan
Visual Studio197
|
| |
|
| |
 |
Jeff

|
Posted: Wed Jun 20 11:51:36 CDT 2007 |
Top |
Visual Basic >> Program Version Number
"vovan" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> In Project Properties in Version Number I see: Major 12, Minor 1,
> Revision 10.
> When I compile my project and via EXE's properties I see Version 12.1.0.10
> Where 0 does come from?
> Is there any place in VB environment to control that third place in
> version number? Now it's always 0.
The 0 is called the Build number and it's not something that you can set
with VB. I did a quick Google search and while this question has come up
before, there has been no satisfactory answer that I've seen other than that
a 3rd-party product called VBAdvance "would be making this possible in its
next release." However, that was years ago and that product is no longer for
sale.
I wonder if you simply couldn't create a Version entry in a resource file
with an external tool (like something from the Platform SDK) and control
your info that way or if VB would clobber that during the MAKE process with
its own version data.
|
| |
|
| |
 |
MikeD

|
Posted: Wed Jun 20 12:19:40 CDT 2007 |
Top |
Visual Basic >> Program Version Number
"Jeff Johnson" <EMail@HideDomain.com> wrote in message
news:%EMail@HideDomain.com...
>
> "vovan" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
>
>> In Project Properties in Version Number I see: Major 12, Minor 1,
>> Revision 10.
>> When I compile my project and via EXE's properties I see Version
>> 12.1.0.10
>> Where 0 does come from?
>> Is there any place in VB environment to control that third place in
>> version number? Now it's always 0.
>
> The 0 is called the Build number and it's not something that you can set
> with VB. I did a quick Google search and while this question has come up
> before, there has been no satisfactory answer that I've seen other than
> that a 3rd-party product called VBAdvance "would be making this possible
> in its next release." However, that was years ago and that product is no
> longer for sale.
>
> I wonder if you simply couldn't create a Version entry in a resource file
> with an external tool (like something from the Platform SDK) and control
> your info that way or if VB would clobber that during the MAKE process
> with its own version data.
I believe VB "overwrites" it, at least that would be my expectation. You
can, however, open the EXE in VC++ (or any tool capable of editing
resources) and change the FILEVERSION of the Version resource. Of course, VB
doesn't provide a way to get the build number either, so you're also going
to have to use the API to do anything with it. Lot of bother for something
so minor.
--
Mike
Microsoft MVP Visual Basic
|
| |
|
| |
 |
Karl

|
Posted: Wed Jun 20 14:45:34 CDT 2007 |
Top |
Visual Basic >> Program Version Number
Jeff Johnson <EMail@HideDomain.com> wrote:
> "vovan" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
>
>> In Project Properties in Version Number I see: Major 12, Minor 1,
>> Revision 10.
>> When I compile my project and via EXE's properties I see Version 12.1.0.10
>> Where 0 does come from?
>> Is there any place in VB environment to control that third place in
>> version number? Now it's always 0.
>
> The 0 is called the Build number and it's not something that you can set
> with VB.
I thought it was the "Revision" number? Officially. I believe VB erroneously calls
the true "Build" number "Revision", but this is the real mccoy.
> I did a quick Google search and while this question has come up
> before, there has been no satisfactory answer that I've seen other than that
> a 3rd-party product called VBAdvance "would be making this possible in its
> next release." However, that was years ago and that product is no longer for
> sale.
Yeah, vbAdvance v3.0 does/did indeed support setting that.
--
.NET: It's About Trust!
http://vfred.mvps.org
|
| |
|
| |
 |
Jeff

|
Posted: Wed Jun 20 15:49:12 CDT 2007 |
Top |
|
| |
 |
Karl

|
Posted: Wed Jun 20 18:28:21 CDT 2007 |
Top |
Visual Basic >> Program Version Number
Jeff Johnson <EMail@HideDomain.com> wrote:
> "Karl E. Peterson" <EMail@HideDomain.com> wrote ...
>
>>> The 0 is called the Build number and it's not something that you can set
>>> with VB.
>>
>> I thought it was the "Revision" number? Officially. I believe VB
>> erroneously calls the true "Build" number "Revision", but this is the real
>> mccoy.
>
> Hmmm. Take a look at this
> http://www.dotnet247.com/247reference/msgs/45/225355.aspx
>
> and then this http://msdn2.microsoft.com/en-us/library/system.version.aspx
>
> For what it's worth.
Well, they contradict themselves, and therefore agree with me! To wit, on the
second link:
==========================================
major.minor[.build[.revision]]
The components are used by convention as follows:
* Major : Assemblies with the same name but different major versions are not
interchangeable. This would be appropriate, for example, for a major rewrite of a
product where backward compatibility cannot be assumed.
* Minor : If the name and major number on two assemblies are the same, but the
minor number is different, this indicates significant enhancement with the intention
of backward compatibility. This would be appropriate, for example, on a point
release of a product or a fully backward compatible new version of a product.
* Build : A difference in build number represents a recompilation of the same
source. This would be appropriate because of processor, platform, or compiler
changes.
* Revision : Assemblies with the same name, major, and minor version numbers but
different revisions are intended to be fully interchangeable. This would be
appropriate to fix a security hole in a previously released assembly.
==========================================
But which field do *their* compilers actually increment during compilation, hmmm? I
declare a doc bug. :-)
--
.NET: It's About Trust!
http://vfred.mvps.org
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio ‹ Visual Basic |
- Next
- 1
- MFC >> Resource leakThis is a multi-part message in MIME format.
------=_NextPart_000_0022_01C39EFE.09B31940
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
What is wrong with this code?
CodeSnitch of Entrek (utility that allows profiling WinCE) emphasise the =
red line as a resourse leak.=20
Assuming that in my test application there is no use of the m_Brush, =
this leak is really weird.
Somebody can explane it?
CPOEApp::CPOEApp(LPCTSTR lpszAppName): CWinApp(lpszAppName)
{
m_Brush.CreateSolidBrush(TOP_LABEL_COLOR); //resource leak
}
CPOEApp::~CPOEApp()
{
m_Brush.DeleteObject();
}
Stas K
------=_NextPart_000_0022_01C39EFE.09B31940
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2800.1264" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY dir=3Dltr>
<DIV>
<P><FONT face=3DArial size=3D2>What is wrong with this code?</FONT></P>
<P><FONT face=3DArial size=3D2>CodeSnitch of Entrek (utility that allows =
profiling=20
WinCE) emphasise the red line as a resourse leak. </FONT></P>
<P><FONT face=3DArial size=3D2>Assuming that in my test application =
there is no use=20
of the m_Brush, this leak is really weird.</FONT></P>
<P><FONT face=3DArial size=3D2>Somebody can explane it?</FONT></P>
<P><FONT face=3DArial size=3D2>CPOEApp::CPOEApp(LPCTSTR lpszAppName):=20
CWinApp(lpszAppName)</FONT></P>
<P><FONT face=3DArial size=3D2>{</FONT></P>
<P><FONT face=3DArial size=3D2> <FONT=20
color=3D#ff0000><STRONG>m_Brush.CreateSolidBrush(TOP_LABEL_COLOR); =
//resource=20
leak</STRONG></FONT></FONT></P>
<P><FONT face=3DArial size=3D2>}</FONT></P>
<P><FONT face=3DArial size=3D2>CPOEApp::~CPOEApp()</FONT></P>
<P><FONT face=3DArial size=3D2>{</FONT></P>
<P><FONT face=3DArial size=3D2> =
m_Brush.DeleteObject();</FONT></P>
<P><FONT face=3DArial size=3D2>}</FONT></P>
<P><FONT face=3DArial size=3D2>Stas K</FONT></P></DIV></BODY></HTML>
------=_NextPart_000_0022_01C39EFE.09B31940--
- 2
- MFC >> ModifyMenuI want to modify the menus, if the user has selected a new languages.
With the Popup- menus in the menu-bar I can do this with
ModifyMenu(..,<level>,MF_BY_POSITION,<level>,<new string>).
In the submenus I can do this with
ModifyMenu(..,<id>,MF_BY_COMMAND,<id>,<new string>).
All this works fine. Sometimes I have also a POPUP for a submenu
within a submenu. In this case a have no identifier, which
with I can change the text. And I cannot use the "MF_BY_POSITION", because
this
works only for menus, but not for submenus.
Who can help me?
Andreas
- 3
- Visual Basic [VB] >> How to reload MDI Child Form into Parent Form.Hi VB.Net Gurus.
Initial MDI Child form loads fine.
exp.
Dim objChild2 As New Form2()
objChild2.MdiParent = Me
objChild2.Show()
MDI Child unloads just fine.
Exp.
If e.Button Is tbbExit Then
'' Me.Close()
Me.Hide()
rs.Close()
cn.Close()
End If
The MDI Child reload does not reload into the parent form.
It reloads outside the parent form.
exp.
Dim oForm As New Form2()
oForm.MdiParent = Me.ActiveMdiChild
oForm.Show()
Regards,
Tony
- 4
- MFC >> strange issue with drag and drop target windowhi there
i am implementing drag n drop in my app using the COleDataSource/
COleDropSource/COleDropTarget classes
everything is going well, but there is one strange thing going on
one of my target windows is a plain ole CWnd-derived window, which has
some child buttons created on it dynamically - i register a
COleDropTarget object for the CWnd-derived parent window, but *not*
for any of the child button windows
when i try to drag onto this window, the COleDropTarget instance that
was registered for the window only gets its OnDragEnter/OnDragOver/
OnDragLeave/OnDrop methods called when the mouse is over one of the
*child* buttons, and never when it is moving over open space within
the window
i check window handles in the COleDropTarget handlers, and the window
passed to these methods has the same handle as my main CWnd-derived
window, *not* the handle of the child button, so that makes sense
also, when i create *no* child buttons on the CWnd-derived window, the
drop handlers don;t get called *at all*
so why oh why shouldn't the COleDropTarget object be called when the
cursor is *anywhere* the registred window?
its driving me nuts
any help will be greatly appreciated
regards
bhu
- 5
- Visual Basic [VB] >> Need a palette expert hereBelow is a small but complete program that appears to show you
can't retrive a Palette from the clipboard.
This is true whether the palette is placed on the clipboard by Photoshop or
Photoshop or by the below program
It lets you place a palette from a file or from a program on the clipboard
and allows you to retrieve one from the clipboard. But you'll find the
retrieved one is always "Nothing"
I'd appreciate comments
Imports System.Drawing.Imaging
Public Class Form1
Inherits System.Windows.Forms.Form
Private WithEvents button1 As System.Windows.Forms.Button
Private WithEvents button2 As System.Windows.Forms.Button
Private WithEvents button3 As System.Windows.Forms.Button
Private components As System.ComponentModel.IContainer
Private cp As ColorPalette
Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Public Sub New()
InitializeComponent()
End Sub 'New
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub 'Dispose
#Region "Windows Form Designer generated code"
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.button1 = New System.Windows.Forms.Button
Me.button2 = New System.Windows.Forms.Button
Me.button3 = New System.Windows.Forms.Button
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout()
'
'button1
'
Me.button1.Location = New System.Drawing.Point(186, 124)
Me.button1.Name = "button1"
Me.button1.Size = New System.Drawing.Size(130, 24)
Me.button1.TabIndex = 2
Me.button1.Text = "Copy File Palette"
Me.ToolTip1.SetToolTip(Me.button1, "Copy Palette from a GIF file to the
clipboard")
'
'button2
'
Me.button2.Location = New System.Drawing.Point(13, 124)
Me.button2.Name = "button2"
Me.button2.Size = New System.Drawing.Size(156, 24)
Me.button2.TabIndex = 2
Me.button2.Text = "Retrieve Clipboard Palette"
Me.ToolTip1.SetToolTip(Me.button2, "Retrieve a palette from the clipboard")
'
'button3
'
Me.button3.Location = New System.Drawing.Point(88, 167)
Me.button3.Name = "button3"
Me.button3.Size = New System.Drawing.Size(130, 24)
Me.button3.TabIndex = 2
Me.button3.Text = "Exit"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(12, 24)
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(304, 47)
Me.TextBox1.TabIndex = 3
Me.TextBox1.Text = "Palette can be placed on clipboard by using the 'Save
Palette"" button or by some " & _
"external program such as Photoshop"
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(13, 85)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(302, 20)
Me.TextBox2.TabIndex = 4
'
'Timer1
'
Me.Timer1.Enabled = True
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(328, 204)
Me.Controls.Add(Me.TextBox2)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.button1)
Me.Controls.Add(Me.button2)
Me.Controls.Add(Me.button3)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub 'InitializeComponent
#End Region
<STAThread()> Shared Sub Main()
Application.Run(New Form1)
End Sub 'Main
Private Sub button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles button1.Click
Dim dlg As New OpenFileDialog
dlg.Filter = "GIF files|*.GIF"
If dlg.ShowDialog() = DialogResult.OK Then
Dim zz As Image = Image.FromFile(dlg.FileName)
Dim DataO As New DataObject
DataO.SetData(DataFormats.Bitmap, False, CType(zz, Bitmap))
DataO.SetData(DataFormats.Palette.ToString, False, zz.Palette)
Clipboard.SetDataObject(DataO, False)
End If
End Sub 'button1_Click
Private Sub button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles button2.Click
Dim DataO As DataObject = CType(Clipboard.GetDataObject(), DataObject)
If DataO.GetDataPresent(DataFormats.Palette, False) Then
cp = CType(DataO.GetData(DataFormats.Palette), ColorPalette)
If cp Is Nothing Then
MessageBox.Show("Contains palette that is Nothing")
Else
MessageBox.Show(cp.ToString)
End If
Else
MessageBox.Show("No Palette on Clipboard")
End If
End Sub 'button2_Click
Private Sub button3_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles button3.Click
Application.Exit()
End Sub 'button3_Click
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Timer1.Tick
Dim DataO As DataObject = CType(Clipboard.GetDataObject(), DataObject)
If DataO.GetDataPresent(DataFormats.Palette, False) Then
Dim cp As ColorPalette = CType(DataO.GetData(DataFormats.Palette),
ColorPalette)
TextBox2.Text = "There is a Palette on the Clipboard"
Else
TextBox2.Text = "The Clipboard does not contain a Palette"
End If
End Sub
End Class 'Form1
- 6
- Visual Basic >> Error while opening a recordsetHi,
I am getting error "Multiple step OLE DB operation generatied errors. Check
each status value" while opening a recordset with records of nearly 4300000.
The records are unique in the table.
I am using the below coding to open the recordset.
With Recordset
.CursorLocation = adUseServer
.Open SQL, Cn, adOpenKeyset, adLockReadOnly
End With
Please can any one help me in finding what's the issue that causes the
error.
Thanks
Valli
- 7
- Visual Basic [VB] >> Run a sub from within a tread?I'm a newbie to threads. I can run
"comboProfiles_SelectedIndexChanged(sender, e)" from any normal sub in my
project however if I run this from within a new thread I've started it
doesn't like "sender" or "e". I know sending info from within a thread is
different but what I'm doing should be simple so if someone can help me out
I sure would appreciate it.
Thanks Much,
Justin
- 8
- 9
- VB Scripts >> help neededIm writing an bat file to rename an file with a new name, and i need to
get the ERRORLEVEL value from this bat file into an VBScript.
I m always getting an zero errorlevel when i run the bat file from the
script
My code is below...
BAT FILE
---------------------------------
@echo off
:: do something that sets errorlevel 1
REN fil fils
echo %ERRORLEVEL%
(this would return an 1 when run from dos prompt)
VBScript
-------------------------------------
Dim fso, wShell, i
Set wShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
i = wShell.Run ("C:\test1.bat", 1, True)
WScript.Echo i
(This should return 1, but returns only 0)
Y is this happening, is there anything wrong with my logic
Rajesh.N
- 10
- 11
- Visual Basic [VB] >> Dynamically adding and iterating through webcontrolsHi everyone,
I created a page which contains a two-column table. The first column has a
bunch of labels, and the second a bunch of textboxes. Here's the code:
======================================================
Protected WithEvents Container As System.Web.UI.WebControls.PlaceHolder
Private Sub ConstructEditTable()
Container.Controls.Add(New LiteralControl("<table>" & vbNewLine))
Dim i As Integer
For i = 0 To rows
With Container.Controls
.Add(New LiteralControl("<tr>" & vbNewLine))
'Label column
.Add(New LiteralControl("<td>" & vbNewLine))
label = New Label
label.ID = "lbl" & i.ToString
label.Text = i.ToString
label.EnableViewState = True
.Add(label)
.Add(New LiteralControl("</td>" & vbNewLine))
'Textbox column
.Add(New LiteralControl("<td>" & vbNewLine))
txtTest = New TextBox
txtTest.ID = "txt" & i.ToString
txtTest.Width = Unit.Pixel(50)
txtTest.EnableViewState = True
.Add(txtTest)
.Add(New LiteralControl("</td>" & vbNewLine))
.Add(New LiteralControl("</tr>" & vbNewLine))
End With
Next
Container.Controls.Add(New LiteralControl("</table>" & vbNewLine))
End Sub
==========================================================
The problem I have is accessing the content of the textboxes after postback.
How do I iterate through the controls in Container? Basically, after
PostBack, I would like to display the same table but with labels in the
second column, instead of textboxes. These labels would display the content
of the textboxes entered prior to PostBack.
Any ideas anyone? Any suggestions would be greatly appreciated.
Cheers,
Dany.
- 12
- MFC >> resource-only DLL and LNK2019 error!!Hi,
i'm developing a resource-only DLL, using /NOENTRY option the linker returns:
error LNK2019: unresolved external symbol _main referenced in function
_mainCRTStartup
Any help!?
Thanks
Ale
- 13
- Visual Basic [VB] >> Application Migration from VB6 to .NETI have an application my partner wrote that would allow an autoresponse to any
Mapi compliant email that apparently in .Net won't, can someone assist me with
fixing this?
Here is the code:
Utilities Module:
Option Explicit
Option Base 1
Public StrSQL As String
Public objSession As MAPI.Session
Public objNewMessage As Message
Public Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Global Const REG_SZ As Long = 1
Global Const REG_DWORD As Long = 4
Global Const HKEY_CURRENT_USER = &H80000001
Global Const ERROR_NONE = 0
Global Const ERROR_BADDB = 1
Global Const ERROR_BADKEY = 2
Global Const ERROR_CANTOPEN = 3
Global Const ERROR_CANTREAD = 4
Global Const ERROR_CANTWRITE = 5
Global Const ERROR_OUTOFMEMORY = 6
Global Const ERROR_INVALID_PARAMETER = 7
Global Const ERROR_ACCESS_DENIED = 8
Global Const ERROR_INVALID_PARAMETERS = 87
Global Const ERROR_NO_MORE_ITEMS = 259
Global Const KEY_ALL_ACCESS = &H3F
Global Const REG_OPTION_NON_VOLATILE = 0
Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (ByRef
lpVersionInformation As OSVERSIONINFO) As Long
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As
Long
Public Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA"
(ByVal hKey As Long, _
ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As
Long, phkResult As Long) As Long
Public Declare Function RegQueryValueExString Lib "advapi32.dll" Alias
"RegQueryValueExA" (ByVal hKey As Long, _
ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long,
ByVal lpData As String, lpcbData As Long) As Long
Public Declare Function RegQueryValueExLong Lib "advapi32.dll" Alias
"RegQueryValueExA" (ByVal hKey As Long, _
ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long,
lpData As Long, lpcbData As Long) As Long
Public Declare Function RegQueryValueExNULL Lib "advapi32.dll" Alias
"RegQueryValueExA" (ByVal hKey As Long, _
ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long,
ByVal lpData As Long, lpcbData As Long) As Long
Public Function QueryValue(sKeyName As String, sValueName As String)
Dim lRetVal As Long 'result of the API functions
Dim hKey As Long 'handle of opened key
Dim vValue As Variant 'setting of queried value
lRetVal = RegOpenKeyEx(HKEY_CURRENT_USER, sKeyName, 0, KEY_ALL_ACCESS,
hKey)
lRetVal = QueryValueEx(hKey, sValueName, vValue)
QueryValue = vValue
RegCloseKey (hKey)
End Function
Function QueryValueEx(ByVal lhKey As Long, ByVal szValueName As String, vValue
As Variant) As Long
Dim cch As Long
Dim lrc As Long
Dim lType As Long
Dim lValue As Long
Dim sValue As String
On Error GoTo QueryValueExError
' Determine the size and type of data to be read
lrc = RegQueryValueExNULL(lhKey, szValueName, 0&, lType, 0&, cch)
If lrc <> ERROR_NONE Then Error 5
Select Case lType
' For strings
Case REG_SZ:
sValue = String(cch, 0)
lrc = RegQueryValueExString(lhKey, szValueName, 0&, lType, sValue, cch)
If lrc = ERROR_NONE Then
vValue = Left$(sValue, cch)
Else
vValue = Empty
End If ' For DWORDS
Case REG_DWORD:
lrc = RegQueryValueExLong(lhKey, szValueName, 0&, lType, lValue, cch)
If lrc = ERROR_NONE Then vValue = lValue
Case Else
'all other data types not supported
lrc = -1
End Select
QueryValueExExit:
QueryValueEx = lrc
Exit Function
QueryValueExError:
Resume QueryValueExExit
End Function
Public Sub SendMail(Recip As String, Subj As String, Body As String)
Dim objOutBox As Folder
Dim objNewMessage As Message
Dim objRecipients As Recipients
Dim objOneRecip As Recipient
'StartMessagingAndLogon
objSession.Logon frmLogin.txtUserName, frmLogin.txtPassword, True, True
Set objOutBox = objSession.Outbox
Set objNewMessage = objOutBox.Messages.Add
Set objRecipients = objNewMessage.Recipients
Set objOneRecip = objRecipients.Add
objOneRecip = Recip
With objNewMessage
.Subject = Subj
.Text = Body
.Send
End With
End Sub
Sub StartMessagingAndLogon()
Dim sKeyName As String
Dim sValueName As String
Dim sDefaultUserProfile As String
Dim osinfo As OSVERSIONINFO
Dim retvalue As Integer
On Error GoTo ErrorHandler
Set objSession = CreateObject("MAPI.Session")
'Try to logon. If this fails, the most likely reason is
'that you do not have an open session. The error
'-2147221231 MAPI_E_LOGON_FAILED will return. Trap
'the error in the ErrorHandler
objSession.Logon ShowDialog:=False, NewSession:=False
Exit Sub
ErrorHandler:
Select Case Err.Number
Case -2147221231 'MAPI_E_LOGON_FAILED
'Need to find out what OS is in use, the keys are different
'for WinNT and Win95.
osinfo.dwOSVersionInfoSize = 148
osinfo.szCSDVersion = Space$(128)
retvalue = GetVersionEx(osinfo)
Select Case osinfo.dwPlatformId
Case 0 'Unidentified
MsgBox "Unidentified Operating System. Can't log onto
messaging."
Exit Sub
Case 1 'Win95
sKeyName = "Software\Microsoft\Windows Messaging
Subsystem\Profiles"
Case 2 'NT
sKeyName = "Software\Microsoft\Windows NT\CurrentVersion\Windows
Messaging Subsystem\Profiles"
End Select
sValueName = "DefaultProfile"
sDefaultUserProfile = QueryValue(sKeyName, sValueName)
objSession.Logon ProfileName:=sDefaultUserProfile, ShowDialog:=False
Exit Sub
Case Else
MsgBox "An error has occured while attempting" & Chr(10) & _
"To create and logon to a new ActiveMessage session." & _
Chr(10) & "Please report the following error to your " & _
"System Administrator." & Chr(10) & Chr(10) & _
"Error Location: frmMain.StartMessagingAndLogon" & _
Chr(10) & "Error Number: " & Err.Number & Chr(10) & _
"Description: " & Err.Description
End Select
End Sub
Public Function CheckInbox(LastChecked As Date)
Dim objInbox As Folder
Dim objMessages As Messages
'Dim objMsgFilter As MessageFilter
Dim objOneMessage As Message
Dim MailBox(1 To 1000, 1 To 6) As Variant
Dim I As Integer
Dim X As Integer
Dim Y As Integer
Dim temp As String
X = 0
'StartMessagingAndLogon
objSession.Logon frmLogin.txtUserName, frmLogin.txtPassword, True, True
Set objInbox = objSession.Inbox
Set objMessages = objInbox.Messages
'Set objMsgFilter = objMessages.Filter
'objMsgFilter.Unread = False
For I = 1 To objMessages.Count
Set objOneMessage = objMessages.Item(I)
If objOneMessage.TimeReceived > LastChecked Then
X = X + 1
MailBox(X, 1) = X
For Y = 2 To 6
Select Case Y
Case 2
temp = objOneMessage.Sender
Case 3
temp = objOneMessage.Subject
Case 4
temp = objOneMessage.Text
Case 5
temp = objOneMessage.TimeReceived
Case 6
On Error Resume Next
If IsNull(objOneMessage.Recipients(1)) Then
temp = ""
Else
temp = objOneMessage.Recipients(1)
End If
On Error GoTo 0
End Select
MailBox(X, Y) = temp
Next Y
End If
Next I
CheckInbox = MailBox
Set objSession = Nothing
End Function
Public Function Resolver(Email As String) As String
Dim objOutBox As Folder
Dim objNewMessage As Message
Dim objRecipients As Recipients
Dim objOneRecip As Recipient
StartMessagingAndLogon
Set objOutBox = objSession.Outbox
Set objNewMessage = objOutBox.Messages.Add
Set objRecipients = objNewMessage.Recipients
Set objOneRecip = objRecipients.Add
With objOneRecip
'Fill in an appropriate alias here
.Name = Email
.Type = ActMsgTo
Resolver = .Resolve ' get MAPI to determine complete e-mail address
End With
Set objOutBox = Nothing
Set objNewMessage = Nothing
Set objRecipients = Nothing
Set objOneRecip = Nothing
End Function
Sub Respond(TimeChecked As Date)
Dim Arr As Variant
Dim Con As New ADODB.Connection
Dim RSEmails As New ADODB.Recordset
Dim RSCustomers As New ADODB.Recordset
Dim Addy As String
Dim temp As String
Dim I As Integer
Dim J As Integer
Dim X As Integer
Set Con = New ADODB.Connection
With Con
.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" &
App.Path & "\ARBack.mdb;"
.Open
End With
RSEmails.Open "SELECT * FROM Outgoing", Con, adOpenForwardOnly,
adLockOptimistic, adCmdText
RSCustomers.Open "SELECT * FROM Customers", Con, adOpenDynamic,
adLockOptimistic, adCmdText
RSEmails.MoveFirst
Arr = CheckInbox(TimeChecked)
For I = 1 To UBound(Arr)
For J = 1 To 6
If Arr(I, J) = "" Then
Exit Sub
End If
Next J
'this is where we do the comparison
Do While Not RSEmails.EOF
Select Case RSEmails!qualifier
Case "sent from"
X = 2
Case "sent to"
X = 6
Case "with subject of"
X = 3
End Select
If InStr(0, Arr(I, 2), "@", vbBinaryCompare) = 0 Then
temp = Arr(I, 2)
Addy = Resolver(temp)
Else
Addy = Arr(I, 2)
End If
If Arr(I, X) = RSEmails!object Then
SendMail Addy, RSEmails!Subject, RSEmails!Body
RSCustomers.AddNew
RSCustomers![login ID] = frmLogin.txtUserName
RSCustomers!emailname = Addy
RSCustomers!Category = RSEmails!Category
RSCustomers!LetterSent = RSEmails!EmailID
RSCustomers.Update
End If
Loop
RSEmails.MoveFirst
Next I
End Sub
System Tray Module:
'user defined type required by Shell_NotifyIcon API call
Public Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uId As Long
uFlags As Long
uCallBackMessage As Long
hIcon As Long
szTip As String * 64
End Type
'constants required by Shell_NotifyIcon API call:
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201 'Button down
Public Const WM_LBUTTONUP = &H202 'Button up
Public Const WM_LBUTTONDBLCLK = &H203 'Double-click
Public Const WM_RBUTTONDOWN = &H204 'Button down
Public Const WM_RBUTTONUP = &H205 'Button up
Public Const WM_RBUTTONDBLCLK = &H206 'Double-click
Public Declare Function SetForegroundWindow Lib "user32" _
(ByVal hwnd As Long) As Long
Public Declare Function Shell_NotifyIcon Lib "shell32" _
Alias "Shell_NotifyIconA" _
(ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Public nid As NOTIFYICONDATA
There is Forms frmLogin, frmOutgoing1, frmUndercover, which is the start up
screen.
frmLogin Code:
Option Explicit
Dim MyCount As Integer
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
'set the global var to false
'to denote a failed login
LoginSucceeded = False
End
End Sub
Private Sub cmdOK_Click()
If MyCount <= 1 Then
MyCount = MyCount + 1
CheckPass
Else
MsgBox "You don't have an account or you are not using the correct
password. Good bye.", vbCritical
End
End If
End Sub
Private Sub CheckPass()
Dim DB As DAO.Database
Dim RS As DAO.Recordset
Dim MyText As String
Set DB = DBEngine.OpenDatabase(App.Path & "\ARBack.mdb")
Set RS = DB.OpenRecordset("users", dbOpenDynaset)
RS.FindFirst "[Login ID] = '" & txtUserName & "'"
If RS.NoMatch Then
On Error Resume Next
MyText = InputBox("You are a new user. Please verify your Password, or
click cancel to exit.", "AutoResoponder Request for Information")
If MyText = "" Then
MsgBox "You must assign a password."
Exit Sub
Else
If MyText = txtPassword Then
RS.AddNew
RS("Login ID") = txtUserName
RS("Password") = MyText
RS.Update
Me.Hide
StrSQL = "SELECT * FROM Outgoing WHERE [Login ID] = '" &
Me("txtUserName") & "'"
MsgBox StrSQL
Load frmOutgoing1
frmOutgoing1("datPrimaryRS").RecordSource = StrSQL
frmUnderCover.Show
Exit Sub
End If
End If
Else
If RS("password") = txtPassword Then
Me.Hide
StrSQL = "SELECT * FROM Outgoing WHERE [Login ID] = '" &
Me("txtUserName") & "'"
'MsgBox StrSQL
Load frmOutgoing1
frmOutgoing1("datPrimaryRS").RecordSource = StrSQL
frmUnderCover.Show
Exit Sub
Else
MsgBox "You have entered an invalid password. Please try again.",
vbOKOnly, "Invalid Password"
txtPassword = ""
txtPassword.SetFocus
Exit Sub
End If
End If
End Sub
frmOutgoing1 Code:
Option Explicit
Dim AddRec As Boolean
Private Sub cboQualifier_Validate(Cancel As Boolean)
If Me("cboqualifier") = "Sent to" Or Me("cboqualifier") = "Sent from" Or
Me("cboqualifier") = "With subject of" Then
Cancel = False
Exit Sub
Else
MsgBox "You must enter an item from the list", vbCritical, "Validation
error"
Me!cboQualifier = "With subject of"
Cancel = True
End If
End Sub
Private Sub CmdClose_Click()
frmUnderCover.Show
Unload Me
End Sub
Private Sub cmdEdit_Click(Index As Integer)
UnlockAllControls
End Sub
'Private Sub cmdEdit_Click()
' UnlockAllControls
'End Sub
Private Sub Form_Load()
With Me("datPrimaryRS")
.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" &
App.Path & "\ARBack.mdb;"
.RecordSource = StrSQL
End With
Me("datPrimaryRS").Refresh
If Not AddRec Then
LockAllControls
End If
AddRec = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmUnderCover.Show
Screen.MousePointer = vbDefault
End Sub
Private Sub datPrimaryRS_Error(ByVal ErrorNumber As Long, Description As
String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String,
ByVal HelpContext As Long, fCancelDisplay As Boolean)
'This is where you would put error handling code
'If you want to ignore errors, comment out the next line
'If you want to trap them, add code here to handle them
MsgBox "Data error event hit err:" & Description
End Sub
'Private Sub datPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum,
ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal
pRecordset As ADODB.Recordset)
' 'This will display the current record position for this recordset
' Dim ThisRec As String
' Dim LastRec As String
'
' ThisRec = CStr(datPrimaryRS.Recordset.AbsolutePosition)
'
' If Not datPrimaryRS.Recordset.EOF Then
'
' LastRec = CStr(datPrimaryRS.Recordset.RecordCount)
' Else
' ThisRec = 0
' LastRec = ThisRec
' End If
'
' datPrimaryRS.Caption = "
Outgoing Mail Record " & ThisRec & " of " & LastRec
'
' If AddRec Then
' UnlockAllControls
' Else
' LockAllControls
' End If
'
'End Sub
'Private Sub datPrimaryRS_WillChangeRecord(ByVal adReason As
ADODB.EventReasonEnum, ByVal cRecords As Long, adStatus As
ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
' 'This is where you put validation code
' 'This event gets called when the following actions occur
' Dim bCancel As Boolean
'
' Select Case adReason
' Case adRsnAddNew
' Case adRsnClose
' Case adRsnDelete
' Case adRsnFirstChange
' Case adRsnMove
' Case adRsnRequery
' Case adRsnResynch
' Case adRsnUndoAddNew
' Case adRsnUndoDelete
' Case adRsnUndoUpdate
' Case adRsnUpdate
' End Select
If bCancel Then adStatus = adStatusCancel
End Sub
Private Sub cmdAdd_Click()
On Error GoTo AddErr
UnlockAllControls
Me!LoginID = frmLogin!txtUserName
AddRec = True
datPrimaryRS.Recordset.AddNew
Me.txtFields(0).SetFocus
Exit Sub
AddErr:
MsgBox Err.Description
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With datPrimaryRS.Recordset
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo UpdateErr
Me.LoginID = frmLogin("txtUsername")
datPrimaryRS.Recordset.UpdateBatch adAffectAll
LockAllControls
Exit Sub
UpdateErr:
MsgBox Err.Description
End Sub
Private Sub UnlockAllControls()
Dim CTL As Control
For Each CTL In Me.Controls
If CTL.Tag = "Tan" Then
CTL.Enabled = True
End If
Next CTL
End Sub
Private Sub LockAllControls()
Dim CTL As Control
For Each CTL In Me.Controls
If CTL.Tag = "Tan" Then
CTL.Enabled = False
End If
Next CTL
End Sub
frmUnderCover Code:
Option Explicit
Dim Working As Boolean
Private Sub Form_Load()
Me!Image3.Picture = Me!Image1.Picture
Me!imgExit.Picture = Me!ExitUnclick.Picture
Me!imgStartService.Picture = Me!StartServiceUnclick.Picture
'the form must be fully visible before calling Shell_NotifyIcon
Me.Show
Me.Refresh
With nid
.cbSize = Len(nid)
.hwnd = Me.hwnd
.uId = vbNull
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.uCallBackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon
.szTip = "Autoresponder (tm)" & vbNullChar
End With
Shell_NotifyIcon NIM_ADD, nid
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim Frm As Form
'this removes the icon from the system tray
Shell_NotifyIcon NIM_DELETE, nid
For Each Frm In Forms
Unload Frm
Next Frm
End
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y
As Single)
'this procedure receives the callbacks from the System Tray icon.
Dim Result As Long
Dim msg As Long
'the value of X will vary depending upon the scalemode setting
If Me.ScaleMode = vbPixels Then
msg = X
Else
msg = X / Screen.TwipsPerPixelX
End If
Select Case msg
Case WM_LBUTTONUP '514 restore form window
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
Case WM_LBUTTONDBLCLK '515 restore form window
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
Case WM_RBUTTONUP '517 display popup menu
Result = SetForegroundWindow(Me.hwnd)
Me.PopupMenu Me.mPopupSys
End Select
End Sub
Private Sub Form_Resize()
'this is necessary to assure that the minimized window is hidden
If Me.WindowState = vbMinimized Then Me.Hide
End Sub
Private Sub Image3_Click()
Load frmOutgoing1
Me.Hide
Working = False
frmOutgoing1.Show
End Sub
Private Sub Image3_MouseDown(Button As Integer, Shift As Integer, X As Single,
Y As Single)
Me!Image3.Picture = Me!Image2.Picture
End Sub
Private Sub Image3_MouseUp(Button As Integer, Shift As Integer, X As Single, Y
As Single)
Me!Image3.Picture = Me!Image1.Picture
End Sub
Private Sub imgExit_Click()
Unload Me
End Sub
Private Sub imgExit_MouseDown(Button As Integer, Shift As Integer, X As Single,
Y As Single)
Me!imgExit.Picture = Me!ExitClick.Picture
End Sub
Private Sub imgExit_MouseUp(Button As Integer, Shift As Integer, X As Single, Y
As Single)
Me!imgExit.Picture = Me!ExitUnclick.Picture
End Sub
Private Sub imgStartService_Click()
StartLoop
Me.WindowState = 1
End Sub
Private Sub imgStartService_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me!imgStartService.Picture = Me!StartServiceClick.Picture
End Sub
Private Sub imgStartService_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Me!imgStartService.Picture = Me!StartServiceUnclick.Picture
End Sub
Private Sub mPopExit_Click()
'called when user clicks the popup menu Exit command
Unload Me
End Sub
Private Sub mPopRestore_Click()
Dim Result As Long
'called when the user clicks the popup menu Restore command
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
End Sub
Private Sub StartLoop()
Dim DB As DAO.Database
Dim Sender As String
Dim RSUsers As DAO.Recordset
Dim RSOutgoing As DAO.Recordset
Dim RSCustomer As DAO.Recordset
Dim TempUser As String
Dim I As Integer
On Error GoTo ServiceHandler
Working = True
Set DB = DBEngine.OpenDatabase(App.Path & "\ARBack.mdb")
DoEvents
On Error GoTo 0
Set RSUsers = DB.OpenRecordset("Users", dbOpenSnapshot)
Set RSOutgoing = DB.OpenRecordset("SELECT * FROM outgoing WHERE [Login ID]
= '" & RSUsers("Login ID") & "'", dbOpenDynaset)
Set RSCustomer = DB.OpenRecordset("Customers", dbOpenDynaset)
If RSOutgoing.EOF Then
MsgBox "You have no outgoing messages entered. Please go back to the
main menu and select 'Add\Edit Emails'", vbInformation, "No Valid outgoing
messages"
imgStartService.Picture = Me.StartServiceUnclick.Picture
Exit Sub
End If
DoEvents
TempUser = RSUsers("Login ID")
Do While Not RSUsers.EOF
If TempUser <> RSUsers("Login ID") Then
GetSessID RSUsers("Login ID"), RSUsers("Password")
Set RSOutgoing = DB.OpenRecordset("SELECT * FROM outgoing WHERE
[Login ID] = '" & RSUsers("Login ID") & "'", dbOpenDynaset)
Me.MAPIMessages1.Fetch
End If
Do While I <= Me.MAPIMessages1.MsgCount - 1
If Me.MAPIMessages1.MsgCount = 0 Then
Exit Do
End If
Me.MAPIMessages1.MsgIndex = I
If CDate(Me.MAPIMessages1.MsgDateReceived) >
DB.Properties("lastchecked") Then
Do While Not RSOutgoing.EOF
If InStrRev(Me.MAPIMessages1.MsgOrigAddress, "=") = 0 And
Me.MAPIMessages1.MsgOrigAddress <> "" Then
Sender = Right(Me.MAPIMessages1.MsgOrigAddress,
Len(Me.MAPIMessages1.MsgOrigAddress) - 5)
Else
Sender = Right(Me.MAPIMessages1.MsgOrigAddress,
(Len(Me.MAPIMessages1.MsgOrigAddress) -
InStrRev(Me.MAPIMessages1.MsgOrigAddress, "=")))
End If
If RSOutgoing("Qualifier") = "sent from" And UCase(Sender)
= UCase(RSOutgoing("Object")) Then
SendMail RSOutgoing("subject"), RSOutgoing("Body"),
Sender
AddCustomer RSOutgoing("category"), Sender,
RSOutgoing("Email ID"), False
End If
If RSOutgoing("Qualifier") = "sent to" And
UCase(RSOutgoing("Login ID")) = UCase(Left(Me.MAPIMessages1.RecipAddress,
InStr(Me.MAPIMessages1.RecipAddress, "@"))) Then
SendMail RSOutgoing("subject"), RSOutgoing("Body"),
Sender
AddCustomer RSOutgoing("category"), Sender,
RSOutgoing("Email ID"), False
End If
If RSOutgoing("Qualifier") = "with subject of" And
UCase(Me.MAPIMessages1.MsgSubject) = UCase(RSOutgoing("object")) Then
If UCase(Me.MAPIMessages1.MsgSubject) <> "REMOVE" Then
SendMail RSOutgoing("subject"), RSOutgoing("Body"),
Sender
AddCustomer RSOutgoing("category"), Sender,
RSOutgoing("Email ID"), False
Else
AddCustomer RSOutgoing("category"), Sender,
RSOutgoing("email ID"), True
End If
End If
RSOutgoing.MoveNext
Loop
RSOutgoing.MoveFirst
End If
If I = Me.MAPIMessages1.MsgCount - 1 Then
Me.MAPIMessages1.MsgIndex = I
DB.Properties("LastChecked") = Me.MAPIMessages1.MsgDateReceived
End If
I = I + 1
DoEvents
Loop
TempUser = RSUsers("Login ID")
RSUsers.MoveNext
Loop
Set DB = Nothing
Set RSOutgoing = Nothing
Set RSCustomer = Nothing
DoEvents
Working = False
Exit Sub
ServiceHandler:
If Err.Number = 3270 Then
Dim Prop As DAO.Property
Set Prop = DB.CreateProperty("LastChecked", dbDate, Now(), True)
DB.Properties.Append Prop
Err.Clear
Resume Next
End If
If Err.Number = 32002 Then
Err.Clear
Exit Sub
End If
End Sub
Private Sub Timer1_Timer()
If Not Working Then
StartLoop
End If
End Sub
Private Sub AddCustomer(Category As String, Sender As String, LetterSent As
String, Remove As Boolean)
Dim DB As DAO.Database
Dim RS As DAO.Recordset
Set DB = DBEngine.OpenDatabase(App.Path & "\ARBack.mdb")
Set RS = DB.OpenRecordset("Customers", dbOpenDynaset)
If Not Remove Then
RS.FindFirst "[Email Name] = '" & Sender & "'"
If RS.NoMatch Then
RS.AddNew
RS("Login ID") = frmLogin.txtUserName
RS("Email Name") = Sender
RS("Category") = Category
RS("letter Sent") = LetterSent
RS.Update
Else
RS.Edit
RS("letter sent") = LetterSent
RS.Update
End If
Else
RS.FindFirst "[Email Name] = '" & Sender & "'"
RS.Delete
End If
Set RS = Nothing
Set DB = Nothing
End Sub
Private Sub SendMail(Subject As String, Body As String, Sender As String)
Me.MAPIMessages1.Compose
Me.MAPIMessages1.MsgSubject = Subject
Me.MAPIMessages1.MsgNoteText = Body
Me.MAPIMessages1.RecipAddress = Sender
Me.MAPIMessages1.AddressResolveUI = True
Me.MAPIMessages1.ResolveName
Me.MAPIMessages1.Send False
End Sub
Private Sub GetSessID(uId As String, PWD As String)
On Error GoTo GetSesshandler
Me.MAPISession1.UserName = uId
Me.MAPISession1.Password = PWD
Me.MAPISession1.SignOn
Me.MAPIMessages1.SessionID = Me.MAPISession1.SessionID
Exit Sub
GetSesshandler:
If Err.Number = 32003 Then
MsgBox "You failed to enter a valid User ID and Password. You will now
be logged off. If you know the name of your mail server, you can set up a new
profile and password by clicking the 'New' button when prompted for a
password.", vbCritical, "Invalid UID and PWD"
Unload Me
End If
End Sub
If this can be done, the code is here for you to make your own Autoresponder,
but even in VB6, with all the Security updates it won't work now. I hope there
is a workaround?
Michael
- 14
- Visual Basic [VB] >> Trying to create a copy of a .NET dllHello,
I'm trying to make a copy of a .NET dll for testing purposes.
I've changed the target of my dll from MyDLL.dll to MyDLLTest.dll. In
the AssemblyInfo.vb, I've changed the from:
<Assembly: AssemblyDescription("My DLL")>
to:
<Assembly: AssemblyDescription("My DLL Test")>
I've then copied the MyDLLTest.dll to the same directory as a VB6 test
harness that I've built and run regasm MyDLLTest.dll /tlb:MyDLLTest.tlb
to create
the type library.
Next, I go to add a reference in my VB6 test harness
and browse to the .tlb file that's in the same directory. I click add
and in the references in my VB6 project I see "My DLL" instead of "My
DLL Test".
Please note that the MyDLL.dll that I'm basing the
MyDLLTest.dll from is registered in COM+. I'm wondering if I need to
change the guid in the AssemblyInfo.vb in order to get "My DLL Test" to
show up in the references description in my VB6 project. I've added
some additional debugging information to to MyDLLTest.dll that's not in
MyDLL.dll.
I want to be able to move this VB6 exe together with MyDLLTest.dll to
another machine that also has MyDLL.dll registered in COM+. I'm
figuring that this way I can see what's going on in MyDLL.dll without
disturbing the existing MyDLL.dll that's registered in COM+.
Thanks,
Eric
- 15
- Visual Basic >> Visual Basic Communication with Serial Port RS232I am attempting to use visual basic to perform a few seemingly simple tasks,
but I have been unsuccessful to do so. I am trying to write a code that can
communicate through a serial port to a microcontroller. All I need the code
to do is to open a com port on my computer, send it the letter g (which
triggers the microcontroller to send back an array of data) and receive an
array of data and write it to a text file. The microcontroller array is a
1440 X 7 array, and all I need the code to do is somehow get this through
the serial port to my computer and make a text file that has the array. If
you know of any way to do this, or anyone who could possibly help me I would
be very greatful! If someone is available, or I need to pay for help
(reasonably of course) I am willing to do so. Thank you for taking the time
to read this and I hope someone out there can find a chance to help me out!
|
|
|