 |
 |
Index ‹ Visual Studio ‹ MFC
|
- Previous
- 1
- Visual Basic >> Identifying MS Access datafields in a VB applicationI have a large database with roughly 14 tables that I need to quite often
make changes to in the same pattern. So I wrote a macro to make those changes
for me which is when i ran into one problem:
I don't know how to identify a data field in a module that isn't related to
the data (ie, not the module of a form). For example one of the tables is
called "History 1" and contains the column titled "Calibration Officer". What
is the correct syntax for VB6 to identify the data?
Thanks for any help!
- 2
- 3
- VB Scripts >> HELP! -- previous page in VB and ASP 3.0Hello all,
I'm writing you because I have a question for you all: how can I capture the
previous page from an ASP file?
I need to add the URL (with parameters if possible) of the previous page to
a table in SQL Server.
For example: the page that captures the info is anydomain.com/asppage.asp
and if the previous page in the browser history is
otherdomain.com/otherpage.asp, I need to be able to capture that information
If possible, of course...
Thanks in advance for your help and prompt response,
SB-R
- 4
- Visual Basic >> Location of const variableHi,
Does the compiled code really run faster (at runtime) when having
constants variable in the form/class/module that they are used or I can
place all of them in a module used only for constant declaration?
Thanks a lot!
Marty
- 5
- MFC >> BROWSEINFO --> How to Show only Show only Hard Disk Driveshi..
I need to browse only Hard drives (if there r C & D, only C drive and D
drive) in my dialog. I dont Know the details. If you now the details
please mail
me.And another thing is upon opening the drive it should display only
the Folders , and should not display Files
- Navin
- 6
- Visual Basic [VB] >> contextMenu Problem!!!hi tring to make a Menu Item Cheked but it doesn't seem to work, any
sugestions ?
'Add Items
Dim countera As Integer
For countera = 0 To 15
Mnu_Sys_over.Items.Add(countera).Tag = countera
'Do i have set the name of the menu item too ?
Next
'Check item
For z = 0 To Mnu_Sys_over.Items.Count - 1
If Mnu_Sys_over.Items(z).Tag =
ListView1.Items(COuntera).Tag Then
Dim SelectedMnuItem As New
MenuItem(Mnu_Sys_over.Items(z).Text)
SelectedMnuItem.Checked = True
End If
Next
- 7
- Visual Basic >> Record Source TroubleThe sql of my forms record source has "Order by date" after the string but
this doesn't do any thing to the order of the records.
Why would this be the case?
- 8
- Visual Basic [VB] >> inherited security strategy neededI'm building an application that uses a folder and object heirarchy
metaphor. I would like to be able to set access rights generically (at the
folder) or specifically (for the object) for groups or individuals. I would
also like to be able to 'inherit' rights from parent folders to child
folders.
Has anyone seen any examples of how this might be done or suggest an
approach?
Thanks,
Craig Buchanan
- 9
- Visual Basic [VB] >> What the deal on generating a help file?I generated a help file when HML Help first cane out. At that time I hade to
download the tool from MS to make the file.
Is that still the case. I looked under VS tools and expected to find a tool
there but I didn't.
What are people doing now days to generate Help?
Thanks
- 10
- Visual Studio C++ >> new invokes VirtualAllocHello everyone,
On Windows, when we allocate large amount of memory, new will call
VirtualAlloc directly, other than call HeapAlloc then through HeapAlloc call
VirtualAlloc indirectly?
Anyone to clarify this?
thanks in advance,
George
- 11
- MFC >> Get the height of the taskbarHi,
In my application I show a dialog according to mouse position click.
I want to ensure that the dialog will be shown completely (that it will
shown within the screen bounds).
I use GetSystemMetrics function to retrieve the screen size, but if the
taskbar is shown then it covers my dialog.
How can I know if the taskbar is shown, and what its height is ?
Yoav.
- 12
- 13
- VB Scripts >> Reading a remote registryHello,
I (like a lot of people) need to go out and verify that certain MS patches have
been installed. I need to read the registry on 500+ servers to see if the
latest MS patch was successfully installed. I have tried several different
scripts, searched the net and this newsgroup and haven't found a way to search a
remote registry. I have placed a code snippet below. Any suggestions will be
greatly appreciated.
Thanks in advance,
Bill Burke
bill@2burkes.com
'********************************
Sub checkPatch(strComputer)
Set WshShell = WScript.CreateObject("WScript.Shell")
If KeyExists (strComputer & "\\HKLM\SOFTWARE\Microsoft\Updates _
\Windows 2000\SP5\KB824146") = False Then
objTextFile.WriteLine strComputer & ";" & "NOT Patched"
WScript.Echo strComputer & vbCrLf & " - Patch Not applied" & vbCrLf
Else
objTextFile.WriteLine strCompuer & ";" & "Successfully Patched"
On Error Resume Next
delFiles(strComputer)
If Err Then
WScript.Echo strComputer & " was not able to delete files."
End If
On Error GoTo 0
End If
End Sub
Function KeyExists (key)
On Error Resume Next
key2 = WSHShell.RegRead (key)
If err <> 0 Then
KeyExists = False
Else
KeyExists = True
End if
End Function
- 14
- MFC >> Please help...:(this error message comes up whe i try to include my header file with mfc
fatal error C1853: 'Debug/tryhello.pch' is not a precompiled header file created with this compile
hello.
-----------
#if defined(__cplusplus
extern "C"
#endi
void Hello()
#if defined(__cplusplus
#endi
what i'm trying do do here is to integrate a .c file into an mfc environment. my expected output is when i click a button a console window would appear that would print HELLO WORLD.
this is the .c file that i am trying to use
hello.
---------------------
#include <stdio.h
#include <stdlib.h
#include <conio.h
#include "hello.h
void Hello(
char c
printf("HELLO WORLD!!!")
c = getch()
what do i need to do to get this to work. my dialog contains a single button and i inserted the function call (Hello( );) on the BN_CLICKED part of the code
please help..:
- 15
- MFC >> sending message to the thread?Which one is the most appropriate to send message to the specified thread
PostThreadMessage
PostMessage
SendMessage
SendMessageTimeOut
Is there any one can explain this ?
Please help us...
Thanks..
|
| Author |
Message |
BonnieT

|
Posted: Wed Oct 19 01:35:43 CDT 2005 |
Top |
MFC >> Bitmap Not Displayed
A bitmap that appears in the MFC dialog editor does not display when the
application runs. The property settings and ID are the same in the VS 2003
version and the VS 6 version. The VS 6 version works fine.
It appears the update from VC++ 6 to VC++ 2003 has changed the mapping to
the runtime bitmap file, but why does the bitmap picture appear (as it
should) in the dialog editor, but not in the running version? The bitmap is
labeled as a "system" bitmap, but this is a custom developed bitmap (lots of
colors).
Any clues to why the bitmap will not display and how to fix it?
Thanks!
--
Dave Boyd
Visual Studio148
|
| |
|
| |
 |
v-garych

|
Posted: Wed Oct 19 01:35:43 CDT 2005 |
Top |
MFC >> Bitmap Not Displayed
Hi Dave,
>A bitmap that appears in the MFC dialog editor does not
>display when the application runs. The property settings
>and ID are the same in the VS 2003 version and the VS 6
>version. The VS 6 version works fine.
I am afraid I am not very clear about how do you display a bitmap in a MFC
dialog, I could not repro this problem in my local machine.
I have tested a VC6 MFC dialog application, with a picture control
displaying a custom bitmap(256 color bit) on it. And opened and upgraded it
in VS2003 IDE. Then rebuild and executed the upgraded application, the
bitmap could be displayed well as expected.
Thanks!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
|
| |
|
| |
 |
daveboyd

|
Posted: Wed Oct 19 11:45:01 CDT 2005 |
Top |
MFC >> Bitmap Not Displayed
Hi Gary,
Thanks for the quick response. Here's some more information -- when I
right-click on the bitmap and attempt to Edit Control I get the following
error message:
Failed to connect.
Link may be broken.
How do I "repair" the link?
--
Dave Boyd
""Gary Chang[MSFT]"" wrote:
> Hi Dave,
>
> >A bitmap that appears in the MFC dialog editor does not
> >display when the application runs. The property settings
> >and ID are the same in the VS 2003 version and the VS 6
> >version. The VS 6 version works fine.
>
> I am afraid I am not very clear about how do you display a bitmap in a MFC
> dialog, I could not repro this problem in my local machine.
>
> I have tested a VC6 MFC dialog application, with a picture control
> displaying a custom bitmap(256 color bit) on it. And opened and upgraded it
> in VS2003 IDE. Then rebuild and executed the upgraded application, the
> bitmap could be displayed well as expected.
>
>
> Thanks!
>
> Best regards,
>
> Gary Chang
> Microsoft Community Support
> --------------------
> Get Secure! ¡§C www.microsoft.com/security
> Register to Access MSDN Managed Newsgroups!
> http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
> &SD=msdn
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
|
| |
|
| |
 |
v-garych

|
Posted: Thu Oct 20 05:40:16 CDT 2005 |
Top |
MFC >> Bitmap Not Displayed
Hi Dave,
>when I right-click on the bitmap and attempt to
>edit Control I get the following error message:
>
>Failed to connect.
>Link may be broken.
>
>How do I "repair" the link?
I could not repro your scenario in my local machine, would you please send
us a self-alone project(zipped) for research, you can send it to me
directly(please remove the "online" word of my email address).
Thanks for your understanding!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
|
| |
|
| |
 |
daveboyd

|
Posted: Fri Oct 28 11:09:06 CDT 2005 |
Top |
MFC >> Bitmap Not Displayed
Gary,
This is part of a large application that I can't send to you, sorry! The
problem is that the VC++ 6 release used a Microsoft Forms 2.0 Image control.
When the program was moved to VC++ 2003 the control broke and the image
disappeared (or the link was broken). The control properties in VS2003 allow
navigating to the bitmap, but the property for PICTURE in the v6 was bitmap,
in this version is seems to have changed to system.drawing.bitmap. How do I
fix the link? or move to a control that works easily?? How hard can it be to
put a bitmap on a dialog screen --- do I really have to rely on user written
code provided in the public domain to learn how to do this simple task (where
is my VB)?
--
Dave Boyd
""Gary Chang[MSFT]"" wrote:
> Hi Dave,
>
> >when I right-click on the bitmap and attempt to
> >edit Control I get the following error message:
> >
> >Failed to connect.
> >Link may be broken.
> >
> >How do I "repair" the link?
>
> I could not repro your scenario in my local machine, would you please send
> us a self-alone project(zipped) for research, you can send it to me
> directly(please remove the "online" word of my email address).
>
>
> Thanks for your understanding!
>
> Best regards,
>
> Gary Chang
> Microsoft Community Support
> --------------------
> Get Secure! ¡§C www.microsoft.com/security
> Register to Access MSDN Managed Newsgroups!
> http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
> &SD=msdn
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
|
| |
|
| |
 |
david

|
Posted: Mon Oct 31 15:20:58 CST 2005 |
Top |
MFC >> Bitmap Not Displayed
Gary,
Upon further investigation the control works in a newly created dialog,
but not in the existing dialogs. Removing and readding the control
doesn't help. Setting the properties of the dialog that doesn't work
to the properties of the new dialog that does work doesn't help. Are
there any known bugs in the MS Forms 2.0 Image control (v11.0.5601.0 --
fm20.dll)? Is there possibly an error in the resource file? Since I
can't reproduce the problem outside my large application, can you
suggest any debugging steps I might be able to take?
Thanks,
Dave
|
| |
|
| |
 |
v-garych

|
Posted: Tue Nov 01 00:17:10 CST 2005 |
Top |
MFC >> Bitmap Not Displayed
Hi Dave,
I noticed you also posted this issue to the dotnet.languages.vc group, I
have already replied it in that group. please check it there.
Thanks!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio ‹ MFC |
- Next
- 1
- VB Scripts >> TOP SECRET MY MOM NEVER TOLD ME!!Discovers the "Secret of making huge money" in just few weeks....
You shall be amazed that how easy 1 can make money on internet just for doing 1 time work..[I GUREENTED U CAN TOO MAKE BIG$$ WITH THIS PROGRAM]........
[Use IE if can't view the site]
http://mysiteinc.com/gohar/index.html
- 2
- Visual Basic [VB] >> connecting remore access 97 databaseHi
I am trying to connect remote access 97 database form ASP.NET page from vb.net using this connection string
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\ServerName\cdrive\Dt\ct\ct.mdb;
I get this erro
"The Microsoft Jet database engine cannot open the file '\\ServerName\cdrive\Dt\ct\ct.mdb' It is already opened exclusively by another user, or you need permission to view its data
If I use with null pwd
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\ServerName\cdrive\Dt\ct\ct.mdb;PWD=
I get this error "Could not find installable ISAM.
Some one please help
Thank
ashra
- 3
- MFC >> SocketHow can I connect to smtp server?
I tried to use CSocket:
CSocket csk;
csk.Create();
csk.Connect("server.com", 25);
but there is an error during connecting to server.com (function Connect
return false)....
Thx for help me
ArtuS
- 4
- MFC >> Screen captures of windows other than one belonging to app.Is there an easy way to perform a screen capture of a window that does
not belong to the application doing the screenshot? I know you can
capture the entire screen, but I would like to capture selected windows.
I'm guessing that it's possible if the capturing app can get hold of the
DC of the target window, but I'm not sure how you do that. Paint
programs seem to be able to do this so I guess it's possible.
(BTW: I'm using VC6 with DirectX 8.0 SDK installed.)
- 5
- MFC >> Text file IOI have a class that inputs data from a text file. The files can be very
large, and I'd like to display a progress bar to the user. Of course, to
determine this I need to know the total number of lines in the file. What's
the most efficient (i.e. fastest) way to get it? Right now I use brute
force: I read through the entire file, counting the lines but not processing
the data (code below). Then I reset the ifstream to prepare for reading the
data. Is there a better way?
Thanks,
Chip
// Construct ifstrem object for file input
ifstream File(Filename, ios::nocreate);
********
// Count total lines in file
streampos StartPos = File.tellg(); // Get file start position
FileLines = 0;
while(!File.eof())
{
File.ignore(1000, '\n'); // Get/ignore line
FileLines++;
}
// Prepare File for reading/processing
File.seekg(StartPos); // Return istream ptr to start position
File.clear(); // Reset eof bit
TRACE("File has %i lines\n", FileLines);
******
// Read data...
- 6
- Visual Basic [VB] >> How to handle nulls in a construcorHi, Im real new at this so be gentle. I want to create a customer
object based on the results of an sql query to the customers table, ie
one object per row, and then add each of these objects to an arraylist
and then on to some datbinding in a listbox. Therefore, for each row
sent back by the datareader, I try to create the new customer object
and pass all the data in the row as part of the constructor. But, I
declared the data fields in the customer class to be the same data type
as those in the database but null causes a problem. To get round the
problem, I just made addtional New constuctors for each column which
may have nulls and then set the datfields to empty strings inside the
constructor and thus not pass the null data at all from the datreader
row. But that is a lot of kludge to test for null before the call to
the constructor so that i call the right constructor. i tried to have
constructors which accepts nulls as arguments and then set the private
data fields to empty strings from there but ran in to cast problems
*(esp with strict ON) in the call to the constructor.
What is the right way to create objects whose private data fields are
of one data type , but whose arguments might be null when they are
instantiated and how should null arguments be specified.
- 7
- Mcse >> system timeoutsI have been trying to do some of the win server 2003
assesment exams and they keep hanging in the middle of the
assesments with unable to display page error. Anyone else
hving this problem? I have tried from two different
locations but about 30% of the time it works and 70% of
the time it fails
- 8
- MFC >> Setting font for StaticText ControlHello,
I'd like to set the size, fontname and color for one of my StaticText
controls on my dialog on a Visual Studio 2005 C++ MFC native project.
I've found out this control has a SetFont method(), which I presume enable
to set the styles as I've mentioned above, but I've got a little confused
about the parameters.
Is the SetFont() method the right/best way for setting the font for the
StaticText control?
If so, how I could set this font from my dialog class?
Do I have to set a member variable for the class for this purpose?
Where is the best place to set the font? The MyDlg::OnInitDialog() ?
Jeová
- 9
- Visual Basic [VB] >> invalid cast prob with oleDBdataReader...
Dim rdr As OleDbDataReader = cmd.ExecuteReader
If rdr.GetString(1).ToString.Length > 0 Then
Console.WriteLine(rdr.GetString(1).ToString)
End If
The field is in an MS Access table that rdr is reading and
is a text field. I am getting an invalid cast error when
the field is null/empty.
I have tried If Not IsDBNull(rdr.GetString(1).ToString)...
still same problem. How can I trap if the field is null?
Thanks
- 10
- Visual Basic [VB] >> MarshalingGuys, please help. I am trying to make this work from at least 4 months.
I am new to programming and some things are difficult to me, but I really
need to make my project work.
I can't find anything helpfull in internet for 4 months ;-( .
Please someone who is more expirenced help me.
I am trying to use the Terminal Server APIs
There is as an API function WTSEnumerateSessions, which returns a
WTS_SESSION_INFO custom structure n times.
Actually it returns pointer to it.
I just can't get it working in VB .NET
While searching through MSDN I've found something, but I need an opinion
from someone more experienced.
The text is:
======
Formatted Non-Blittable Classes
Formatted non-blittable classes have fixed layout (formatted) but the data
representation is different in managed and unmanaged memory. The data can
require transformation under the following conditions:
If a non-blittable class is marshaled by value, the callee receives a
pointer to a copy of the data structure.
If a non-blittable class is marshaled by reference, the callee receives
a pointer to a pointer to a copy of the data structure.
If the InAttribute attribute is set, this copy is always initialized
with the instance's state, marshaling as necessary.
If the OutAttribute attribute is set, the state is always copied back to
the instance on return, marshaling as necessary.
If both InAttribute and OutAttribute are set, both copies are required.
If either attribute is omitted, the marshaler can optimize by eliminating
either copy.
Found at:
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconconsumingunmanageddllfunctions.asp)
======
According to this the date returned from WTSEnumerateSessions function is a
pointer to a pointer a copy of the data structure.
Or I am wrong?
If I am right, how to get this second pointer from VB .NET?
Here are the API Function and structure, by definition and how I've defined
them in my app
API
=====
WTS_SESSION_INFO
The WTS_SESSION_INFO structure contains information about a client session
on a terminal server.
typedef struct _WTS_SESSION_INFO { DWORD SessionId; LPTSTR
pWinStationName; WTS_CONNECTSTATE_CLASS State;
} WTS_SESSION_INFO, *PWTS_SESSION_INFO;
WTSEnumerateSessions
The WTSEnumerateSessions function retrieves a list of sessions on a
specified terminal server.
BOOL WTSEnumerateSessions(
HANDLE hServer,
DWORD Reserved,
DWORD Version,
PWTS_SESSION_INFO* ppSessionInfo,
DWORD* pCount
);
=====
And in my code
====
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
Private Structure WTS_SESSION_INFO
Dim SessionID As Int32 'DWORD integer
Dim pWinStationName As String ' integer LPTSTR - Pointer to a
null-terminated string containing the name of the WinStation for this
session
Dim State As WTS_CONNECTSTATE_CLASS
End Structure
<DllImport("wtsapi32.dll", _
bestfitmapping:=True, _
CallingConvention:=CallingConvention.StdCall, _
CharSet:=CharSet.Auto, _
EntryPoint:="WTSEnumerateSessions", _
SetLastError:=True, _
ThrowOnUnmappableChar:=True)> _
Private Shared Function WTSEnumerateSessions2( _
ByVal hServer As IntPtr, _
<MarshalAs(UnmanagedType.U4)> _
ByVal Reserved As Int32, _
<MarshalAs(UnmanagedType.U4)> _
ByVal Vesrion As Int32, _
ByRef ppSessionInfo As IntPtr, _
<MarshalAs(UnmanagedType.U4)> _
ByRef pCount As Int32) As Int32
End Function
TIA
- 11
- MFC >> mfc class wizard pops up everytime!hi,
i just started with vc7 with an MFC dialog box project. I added
some controls and attached variables... it worked out fine. I
don't know what happened but now every control I doubleclick
pops up the MFC Class Wizard. Right-clicking any control does
not show the ADD VARIABLE option anymore. The ClassView
does not show TestMFCDlg as a class anymore (the AboutDlg
class is there and I can add variables to it as well!)
Can somebody please tell me what went wrong?
IDE version: 7.0.9466
Thank you.
dtor
- 12
- VB Scripts >> Scirpt to disable a windows serviceHi...How can I stop and disable a windows service using vbscript?
Here's what I have to stop it but how do I disable it???...
Set WshShell=WScript.CreateObject("WScript.Shell")
ServiceName = """Alerter"""
Result = WshShell.Run("net stop " & ServiceName, 0, True)
- 13
- Mcse >> MCSE 2003 Expiration?Well, Microsoft has released bunch of new track like MCPD and etc.
But it seems that nothing equivalent of new MCSE has come up.
So how long do you think new MCSE will come up? Will it be after the relase
of Vista? Or should I just persue MCSE.
- 14
- 15
- Visual Basic [VB] >> Adding the rebooting code to the setup project !Hi EveryBody:
Is there any way to add the rebooting code to the user interface of the setup project in VB.net ? if the answer is yes,how can I do it ?
but if the answer is no, Is there any way to add dialog that I made by myself which consist of the rebooting code to the user inteface of the setup project ? if the answer is yes, how can I do it ?
But if the answer is now, Is there any way to let my setup project rebooting after the installation is done?
any help will be appreciated.
al-ahmadi
|
|
|