|
Hello,
I am working in Visual Studio 2008. I currently have a project that was created years ago that deals with COM components. Now, however, I need to add new functionality to this old project. The new functionality would be easiest if we used ATL. However, the problem is that the old project is not an ATL project.
So, my question is: Is there any (easy) way to convert my old project to an ATL compatible project?
Thanks in advance,
Nick
P.S. If my description is too vague or there are any questions just let me know. Thanks.modified on Tuesday, March 2, 2010 2:21 PM
|
|
|
|
|
And this has what to do with the .NET Framework??
Ask this in the C/C++/MFC forum instead.
|
|
|
|
|
Working with VSTS 2008. Looking for an addin that would allow development for bluetooth headsets [cellphone headsets/earphones] Ideally, none of the features of VSTS e.g. "Intellisense" would not be lost. Additionally, looking for information on the existence of emulation for bluetooth headsets by brand and model. Guidance sought
|
|
|
|
|
Bluetooth devices do not use the .NET Framwework. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Much thanks for your timely reply. I am a systems administrator and not a developer seeking some guidance on the process of development for bluetooth headsets. Would appreciate some continued guidance on how to go about developing code for bluetooth headsets. Is there a broadbased development platform that would work for the majority of retail brands? Is there emulation for the variety of models. Much appreciation for your continued support.
|
|
|
|
|
I've never heard of such a thing. I've also never heard of anyone developing code for a headset. What are you trying to do with this?
|
|
|
|
|
Much thanks for your reply. I write as a Windows systems administrator and would like to cultivate my knowledge in development. In the interim, I have been told that the .NET framework does not figure into bluetooth. I have been deliberating over an idea where the cellphone headset that often accompanies cell phones could be used to control another type of device. It is the ability of the headset to convert speech into commands that I would like to direct to another type of electronics.
My novice status requires that I seek guidance from the informed. My thought was that an idea the held my attention would be a motivating factor while working through the learning curve. I would ask the following:
- Is there a bluetooth development platform that would would include most of the major brands?
- What would be the barriers to to such a project?
Visual Studio Teams Suite was part of my initial query only because it was given to me at a technet session. Any guidance would truly be appreciated.
Cordially,
Maurice Newsome, Microsoft Certified Professional
|
|
|
|
|
mauricemcse wrote: It is the ability of the headset to convert speech into commands that I would like to direct to another type of electronics.
It's not the headset that does anyn kind of speech command interpretation. That's the job of the device that the headset is paired to.
mauricemcse wrote: - Is there a bluetooth development platform that would would include most of the major brands?
No.
mauricemcse wrote: - What would be the barriers to to such a project?
A complete understanding of Bluetooth and what it's capabilities and limitations are.
|
|
|
|
|
Hello,
I would like to ask why do I get a run time error that says
"invalid insert into command" while updating a database records. But if the database records field is less than 8 it works well.
The database I am using is ms access/.mdb and the connection I use is oledb connection.
Any comments or suggestion are kindly appreciated.
Thanks,
dfan23
|
|
|
|
|
That error indicates you are trying to insert some invalid data into your database. Without knowing how you db is laid out and what you are trying to insert, there's no way to know what went wrong.
Common problems include trying to save data that isn't consistent with the db field definition, trying to duplicate a primary key value, trying to save into a field that doesn't exist, etc.CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Hello,
Sir this my database
FIELD Name | Data Type
ID number
lastName text
firstName text
middleName text
contactNum number
add text
eAdd text
status text
position text
This is my save code command
Try
con.Open()
Dim dt As New DataTable
Dim ds As New DataSet
ds = New DataSet("DataSet")
ds.Tables.Add(dt)
Dim da As OleDbDataAdapter
da = New OleDbDataAdapter("Select * from empTable", con)
da.Fill(dt)
con.Close()
Dim newrow As DataRow = dt.NewRow
With newrow
.Item("ID") = Val(txtEmpIDAdd.Text)
.Item("lastName") = txtLastAdd.Text
.Item("firstName") = txtFirstAdd.Text
.Item("middleName") = txtMiddleAdd.Text
.Item("contactNumber") = Val(txtContactAdd.Text)
.Item("add") = txtAddressAdd.Text
.Item("eAdd") = txtEmailAdd.Text
.Item("status") = cmbStatusAdd.Text
.Item("position") = txtPositionAdd.Text
End With
dt.Rows.Add(newrow)
con.Open()
da = New OleDbDataAdapter("Select * from empTable", con)
Dim cb As New OleDbCommandBuilder
cb = New OleDb.OleDbCommandBuilder(da)
da.Update(dt)
con.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
This save code does not work if my database field is 9 above,
but when I delete some fields the code work.
Thanks for immediate response.
Thanks,
dfan23
|
|
|
|
|
Hello,
I got the solution now sir.
I have noticed that word "position" is a reserved word in
database
thanks,
dfan23
|
|
|
|
|
Great! Glad to hear you found the problem.
I've run into problems with reserved words, too. It can be very frustrating!CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Your 8th field appears to have an issue when inserting into the database.
Post some code here and someone will be able to help.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hello,
Sir this my database
FIELD Name | Data Type
ID number
lastName text
firstName text
middleName text
contactNum number
add text
eAdd text
status text
position text
This is my save code command
Try
con.Open()
Dim dt As New DataTable
Dim ds As New DataSet
ds = New DataSet("DataSet")
ds.Tables.Add(dt)
Dim da As OleDbDataAdapter
da = New OleDbDataAdapter("Select * from empTable", con)
da.Fill(dt)
con.Close()
Dim newrow As DataRow = dt.NewRow
With newrow
.Item("ID") = Val(txtEmpIDAdd.Text)
.Item("lastName") = txtLastAdd.Text
.Item("firstName") = txtFirstAdd.Text
.Item("middleName") = txtMiddleAdd.Text
.Item("contactNumber") = Val(txtContactAdd.Text)
.Item("add") = txtAddressAdd.Text
.Item("eAdd") = txtEmailAdd.Text
.Item("status") = cmbStatusAdd.Text
.Item("position") = txtPositionAdd.Text
End With
dt.Rows.Add(newrow)
con.Open()
da = New OleDbDataAdapter("Select * from empTable", con)
Dim cb As New OleDbCommandBuilder
cb = New OleDb.OleDbCommandBuilder(da)
da.Update(dt)
con.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
This save code does not work if my database field is 9 above,
but when I delete some fields the code work.
Thanks for immediate response.
Thanks,
dfan23
|
|
|
|
|
Hi,
rather than providing some information twice, you'd better tell us which database you are using, and what the exact error/exception information is you are getting for one or two specificied situations ("when I delete some fields the code work" is too vague). Your app is showing Exception.ToString() which is very good, but you failed to reproduce it here.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Hello,
Sir the database I am using is ms Access database
Thanks,
dfan23
|
|
|
|
|
Hello,
I got the solution now sir.
I have noticed that word "position" is a reserved word in
database.
thanks,
dfan23
|
|
|
|
|
Hi All,
This is my first post and hope i am placing it in the right forums -
I have the following class
Class User
Dim UserID as integer
Dim IsActive as boolean
Dim Username as string
End Class
i need to perform lookups on UserID or IsActive
Get user with ID = X (returns one object)
Get all active Users (returns multiple objects - possibly a list)
Get all inactive users (returns multiple objcets - possibly a list)
for quicker retrieval using userid, i intend to use the generics dictionary
dim Users as Dictionary (Of integer, User)
are there any generics implementations which allow me to use quickly retrieve all active users or inactive users as well?
Just wanted to check with you experts before embarking on my own.
Thanks in advance
Kalyan
|
|
|
|
|
you could:
- just use a dictionary (key=UserId) and test IsActive as appropriate;
- keep one dictionary (key=UserId), and two lists (one with active, one with inactive users);
- keep two dictionaries, one with active and one with inactive users;
- use a DataTable;
- use lambda expressions.
IMO the best choice depends a bit on the circumstances where you need it.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Hi Luc,
Thanks for a quick reply.
I looked at generics and was hoping there may be a complex alternative which i might find interesting
i have opted for the following to keep it simple
1 dictionary for quick retrieval by userid
2 lists for containing active and inactive users.
i wonder how this will scale for larger number of users!
Thanks to you i learnt about lambda expressions today.
Go you still prefer datatables for these kind of operations when dealing with disconnected data?
Cheers
Kalyan
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
HI to all.
I have a simple question. I'm trying to create a bitmap from a memory stream. The memory stream is filled with a byte array and there isn't image information, only raw pixel data.
Now I'm confusing because the C# sample code I found in internet runs without errors
<br />
private Image GetImage (long position, int size)<br />
{<br />
string string1;<br />
byte[] byteArray1;<br />
Bitmap bitmap1;<br />
Stream stream1 = ((Stream) null);<br />
BinaryReader binaryReader1 = ((BinaryReader) null);<br />
MemoryStream memoryStream1 = ((MemoryStream) null);<br />
try<br />
{<br />
string1 = string.Format ("{0}gallery{1:D2}.enc", Session.RootPath, this.index);<br />
stream1 = ((Stream) File.OpenRead (string1));<br />
binaryReader1 = new BinaryReader (stream1, Encoding.ASCII);<br />
long int64_1 = binaryReader1.BaseStream.Seek (position, SeekOrigin.Begin);<br />
byteArray1 = binaryReader1.ReadBytes (size);<br />
this.ColorBalance (byteArray1);<br />
memoryStream1 = new MemoryStream (byteArray1);<br />
try<br />
{<br />
bitmap1 = new Bitmap (((Stream) memoryStream1));<br />
}<br />
catch<br />
{<br />
bitmap1 = new Bitmap (64, 64);<br />
}<br />
}<br />
finally<br />
{<br />
if (memoryStream1 != null)<br />
{<br />
memoryStream1.Close ();<br />
memoryStream1 = ((MemoryStream) null);<br />
}<br />
if (binaryReader1 != null)<br />
{<br />
binaryReader1.Close ();<br />
binaryReader1 = ((BinaryReader) null);<br />
}<br />
if (stream1 != null)<br />
{<br />
stream1.Close ();<br />
stream1 = ((Stream) null);<br />
}<br />
}<br />
return bitmap1;<br />
}<br />
while the conversion to VB.Net (2008) written by me raise an exception
<br />
Private Function _getImage(ByVal _position As Long, ByVal _size As Integer)<br />
Dim _bmp As New Bitmap(64, 64)<br />
Try<br />
Dim _stream As Stream = File.OpenRead(_file)<br />
Dim _binaryReader As BinaryReader = New BinaryReader(_stream, Encoding.ASCII)<br />
<br />
Dim _int64 As Long = _binaryReader.BaseStream.Seek(_position, SeekOrigin.Begin)<br />
Dim _byteArray As Byte() = _binaryReader.ReadBytes(_size)<br />
<br />
_colorBalance(_byteArray)<br />
Dim _memoryStream As New MemoryStream(_byteArray)<br />
_bmp = Bitmap.FromStream(_memoryStream) '<--- "Invalid data" exception<br />
<br />
_memoryStream.Close()<br />
_binaryReader.Close()<br />
_stream.Close()<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message, "Get Image error", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
End Try<br />
Return _bmp<br />
End Function<br />
Why the C# code runs and the VB not? Where I'm wrong?
Thanks.
Perry
P.S.: sorry my english, if you can...
|
|
|
|
|
Instead of :
xry2006 wrote: _bmp = Bitmap.FromStream(_memoryStream)
I recommend :
_bmp = New Bitmap(_memoryStream)
A subtle difference I know, howeer the difference is more than just returning a bitmap rather than an image.
Bitmap.FromStream ends up calling GdipLoadImageFromStream in the GDIPlus.dll
New Bitmap(stream) calls GdipCreateBitmapFromStream in the GDIPlus.dll
I assume the Bitmap version includes more handling for different image types.
|
|
|
|
|
Hi. Thanks for the reply. I'd try your suggestion but the exception "Invalid parameter" remain.
|
|
|
|